1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Make the tests pass

This commit is contained in:
Travis Ralston
2020-01-23 20:41:52 -07:00
parent 3c1dca6cef
commit b8092cd00b
5 changed files with 36 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
import {TestClient} from '../../../TestClient';
import {MatrixEvent} from "../../../../src/models/event";
import nodeCrypto from "crypto";
export async function makeTestClients(userInfos, options) {
const clients = [];
@@ -102,3 +103,15 @@ export async function makeTestClients(userInfos, options) {
return clients;
}
export function setupWebcrypto() {
global.crypto = {
getRandomValues: (buf) => {
return nodeCrypto.randomFillSync(buf);
},
};
}
export function teardownWebcrypto() {
global.crypto = undefined;
}