add close method to policyworker for testing purposes

This commit is contained in:
Siddharth Singh 2025-05-07 07:06:12 +05:30
parent 42f581d350
commit e1d4a00a93
No known key found for this signature in database
2 changed files with 8 additions and 0 deletions

View file

@ -86,4 +86,8 @@ export class PolicyWorker implements NPolicy {
throw new Error(`DITTO_POLICY (error importing policy): ${conf.policy}`);
}
}
[Symbol.dispose]() {
this.worker.close();
}
}

View file

@ -85,6 +85,10 @@ export class CustomPolicy implements NPolicy {
this.policy = new PipePolicy(policies);
}
close() {
self.close();
}
}
Comlink.expose(new CustomPolicy());