1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-05 09:10:53 +01:00
bitwarden-browser/libs/common/test.setup.ts

18 lines
327 B
TypeScript
Raw Normal View History

import { webcrypto } from "crypto";
import { toEqualBuffer } from "./spec";
Object.defineProperty(window, "crypto", {
value: webcrypto,
});
// Add custom matchers
expect.extend({
toEqualBuffer: toEqualBuffer,
});
export interface CustomMatchers<R = unknown> {
toEqualBuffer(expected: Uint8Array | ArrayBuffer): R;
}