Add no-misused/floating-promises lint rule

This commit is contained in:
Fedor Indutny 2022-12-21 10:41:48 -08:00 committed by GitHub
parent 1a68c3db62
commit ed271d92ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
150 changed files with 1296 additions and 991 deletions

View file

@ -51,21 +51,22 @@ describe('Message', () => {
STORAGE_KEYS_TO_RESTORE.forEach(key => {
oldStorageValues.set(key, window.textsecure.storage.get(key));
});
window.textsecure.storage.put('number_id', `${me}.2`);
window.textsecure.storage.put('uuid_id', `${ourUuid}.2`);
await window.textsecure.storage.put('number_id', `${me}.2`);
await window.textsecure.storage.put('uuid_id', `${ourUuid}.2`);
});
after(async () => {
await window.Signal.Data.removeAll();
await window.storage.fetch();
oldStorageValues.forEach((oldValue, key) => {
if (oldValue) {
window.textsecure.storage.put(key, oldValue);
} else {
window.textsecure.storage.remove(key);
}
});
await Promise.all(
Array.from(oldStorageValues.entries()).map(([key, oldValue]) => {
if (oldValue) {
return window.textsecure.storage.put(key, oldValue);
}
return window.textsecure.storage.remove(key);
})
);
});
beforeEach(function beforeEach() {