Files
common/packages/util-crypto/src/crypto.spec.ts
T
2022-01-10 11:48:47 +02:00

17 lines
477 B
TypeScript

// Copyright 2017-2022 @polkadot/util authors & contributors
// SPDX-License-Identifier: Apache-2.0
describe('cryptoWaitReady', (): void => {
it('should return false when it cannot initialize', async (): Promise<void> => {
const old = global.WebAssembly;
global.WebAssembly = null as unknown as typeof WebAssembly;
const { cryptoWaitReady } = await import('./crypto');
expect(await cryptoWaitReady()).toBe(false);
global.WebAssembly = old;
});
});