You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-12-04 05:02:41 +03:00
s/beforeEach/beforeAll/ for Olm.init() and cleanup sas.spec.js
This commit is contained in:
@@ -25,8 +25,8 @@ describe("Crypto", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(function(done) {
|
beforeAll(function() {
|
||||||
Olm.init().then(done);
|
return Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Crypto exposes the correct olm library version", function() {
|
it("Crypto exposes the correct olm library version", function() {
|
||||||
|
|||||||
@@ -25,14 +25,16 @@ describe("MegolmDecryption", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeAll(function() {
|
||||||
|
return Olm.init();
|
||||||
|
});
|
||||||
|
|
||||||
let megolmDecryption;
|
let megolmDecryption;
|
||||||
let mockOlmLib;
|
let mockOlmLib;
|
||||||
let mockCrypto;
|
let mockCrypto;
|
||||||
let mockBaseApis;
|
let mockBaseApis;
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeEach(async function() {
|
||||||
await Olm.init();
|
|
||||||
|
|
||||||
mockCrypto = testUtils.mock(Crypto, 'Crypto');
|
mockCrypto = testUtils.mock(Crypto, 'Crypto');
|
||||||
mockBaseApis = {};
|
mockBaseApis = {};
|
||||||
|
|
||||||
|
|||||||
@@ -48,12 +48,14 @@ describe("OlmDecryption", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeAll(function() {
|
||||||
|
return global.Olm.init();
|
||||||
|
});
|
||||||
|
|
||||||
let aliceOlmDevice;
|
let aliceOlmDevice;
|
||||||
let bobOlmDevice;
|
let bobOlmDevice;
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeEach(async function() {
|
||||||
await global.Olm.init();
|
|
||||||
|
|
||||||
aliceOlmDevice = makeOlmDevice();
|
aliceOlmDevice = makeOlmDevice();
|
||||||
bobOlmDevice = makeOlmDevice();
|
bobOlmDevice = makeOlmDevice();
|
||||||
await aliceOlmDevice.init();
|
await aliceOlmDevice.init();
|
||||||
|
|||||||
@@ -128,6 +128,10 @@ describe("MegolmBackup", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
beforeAll(function() {
|
||||||
|
return Olm.init();
|
||||||
|
});
|
||||||
|
|
||||||
let olmDevice;
|
let olmDevice;
|
||||||
let mockOlmLib;
|
let mockOlmLib;
|
||||||
let mockCrypto;
|
let mockCrypto;
|
||||||
@@ -136,7 +140,6 @@ describe("MegolmBackup", function() {
|
|||||||
let cryptoStore;
|
let cryptoStore;
|
||||||
let megolmDecryption;
|
let megolmDecryption;
|
||||||
beforeEach(async function() {
|
beforeEach(async function() {
|
||||||
await Olm.init();
|
|
||||||
mockCrypto = testUtils.mock(Crypto, 'Crypto');
|
mockCrypto = testUtils.mock(Crypto, 'Crypto');
|
||||||
mockCrypto.backupKey = new Olm.PkEncryption();
|
mockCrypto.backupKey = new Olm.PkEncryption();
|
||||||
mockCrypto.backupKey.set_recipient_key(
|
mockCrypto.backupKey.set_recipient_key(
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ describe("Cross Signing", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeAll(function() {
|
||||||
await global.Olm.init();
|
return global.Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should sign the master key with the device key", async function() {
|
it("should sign the master key with the device key", async function() {
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ describe("Secrets", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeAll(function() {
|
||||||
await global.Olm.init();
|
return global.Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should store and retrieve a secret", async function() {
|
it("should store and retrieve a secret", async function() {
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ describe("QR code verification", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeAll(function() {
|
||||||
await Olm.init();
|
return Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("showing", function() {
|
describe("showing", function() {
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ describe("verification request", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeAll(function() {
|
||||||
await Olm.init();
|
return Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should request and accept a verification", async function() {
|
it("should request and accept a verification", async function() {
|
||||||
|
|||||||
@@ -45,8 +45,8 @@ describe("SAS verification", function() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(async function() {
|
beforeAll(function() {
|
||||||
await Olm.init();
|
return Olm.init();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should error on an unexpected event", async function() {
|
it("should error on an unexpected event", async function() {
|
||||||
@@ -169,6 +169,12 @@ describe("SAS verification", function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
afterEach(async function() {
|
||||||
|
await Promise.all([
|
||||||
|
alice.stop(),
|
||||||
|
bob.stop(),
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
|
||||||
it("should verify a key", async function() {
|
it("should verify a key", async function() {
|
||||||
let macMethod;
|
let macMethod;
|
||||||
|
|||||||
Reference in New Issue
Block a user