mirror of
https://github.com/bitwarden/browser.git
synced 2024-08-29 23:49:50 +02:00
* Create base jest.config file * Fix various tests that were broken * Add maxWorkers to jest config * Undo change to testEnvironment * Enable tsconfig.spec.json
28 lines
595 B
TypeScript
28 lines
595 B
TypeScript
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 */
|