You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-06-15 23:00:36 +02:00
Tests: Integration harness fixes and refactors. (#2569)
* Test harness fixes and integration test refactor and addition. * Clean up. * Address review comments. * Improve method names.
This commit is contained in:
@ -37,9 +37,9 @@ class DecryptionWorker {
|
||||
}
|
||||
|
||||
static instance() {
|
||||
if (this.instance_) return this.instance_;
|
||||
this.instance_ = new DecryptionWorker();
|
||||
return this.instance_;
|
||||
if (DecryptionWorker.instance_) return DecryptionWorker.instance_;
|
||||
DecryptionWorker.instance_ = new DecryptionWorker();
|
||||
return DecryptionWorker.instance_;
|
||||
}
|
||||
|
||||
setEncryptionService(v) {
|
||||
@ -250,8 +250,15 @@ class DecryptionWorker {
|
||||
}
|
||||
}
|
||||
|
||||
async cancelTimers() {
|
||||
if (this.scheduleId_) clearTimeout(this.scheduleId_);
|
||||
async destroy() {
|
||||
this.eventEmitter_.removeAllListeners();
|
||||
if (this.scheduleId_) {
|
||||
clearTimeout(this.scheduleId_);
|
||||
this.scheduleId_ = null;
|
||||
}
|
||||
this.eventEmitter_ = null;
|
||||
DecryptionWorker.instance_ = null;
|
||||
|
||||
return new Promise((resolve) => {
|
||||
const iid = setInterval(() => {
|
||||
if (!this.startCalls_.length) {
|
||||
@ -263,4 +270,6 @@ class DecryptionWorker {
|
||||
}
|
||||
}
|
||||
|
||||
DecryptionWorker.instance_ = null;
|
||||
|
||||
module.exports = DecryptionWorker;
|
||||
|
Reference in New Issue
Block a user