bitwardenjavascripttypescriptangularelectronclidesktopnodejswebextensionfirefoxbrowser-extensionchromesafari
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
595 B
27 lines
595 B
import { webcrypto } from "crypto"; |
|
|
|
import { toEqualBuffer } from "./spec/matchers/toEqualBuffer"; |
|
|
|
Object.defineProperty(window, "crypto", { |
|
value: webcrypto, |
|
}); |
|
|
|
// Add custom matchers |
|
|
|
expect.extend({ |
|
toEqualBuffer: toEqualBuffer, |
|
}); |
|
|
|
interface CustomMatchers<R = unknown> { |
|
toEqualBuffer(expected: Uint8Array | ArrayBuffer): R; |
|
} |
|
|
|
/* eslint-disable */ |
|
declare global { |
|
namespace jest { |
|
interface Expect extends CustomMatchers {} |
|
interface Matchers<R> extends CustomMatchers<R> {} |
|
interface InverseAsymmetricMatchers extends CustomMatchers {} |
|
} |
|
} |
|
/* eslint-enable */
|
|
|