Upgrade to jest 27 (#7699)
* use jest@27.4.0, replace jest-environment-jsdom-sixteen with jest-environment-jsdom Signed-off-by: Kerry Archibald <kerrya@element.io> * polyfill setImmediate Signed-off-by: Kerry Archibald <kerrya@element.io> * remove done from async test cases * useRealTimers in test relying on promise flushing Signed-off-by: Kerry Archibald <kerrya@element.io> * remove jest environment file Signed-off-by: Kerry Archibald <kerrya@element.io> * replace ts-jest mocked with jest utils mocked Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
@@ -53,21 +53,19 @@ describe("canEncryptToAllUsers", () => {
|
||||
"@badUser:localhost": {},
|
||||
};
|
||||
|
||||
it("returns true if all devices have crypto", async (done) => {
|
||||
it("returns true if all devices have crypto", async () => {
|
||||
const client = {
|
||||
downloadKeys: async function(userIds) { return trueUser; },
|
||||
};
|
||||
const response = await canEncryptToAllUsers(client, ["@goodUser:localhost"]);
|
||||
expect(response).toBe(true);
|
||||
done();
|
||||
});
|
||||
|
||||
it("returns false if not all users have crypto", async (done) => {
|
||||
it("returns false if not all users have crypto", async () => {
|
||||
const client = {
|
||||
downloadKeys: async function(userIds) { return { ...trueUser, ...falseUser }; },
|
||||
};
|
||||
const response = await canEncryptToAllUsers(client, ["@goodUser:localhost", "@badUser:localhost"]);
|
||||
expect(response).toBe(false);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user