2022-03-28 16:00:42 +02:00
|
|
|
import { webcrypto } from "crypto";
|
|
|
|
|
2023-05-09 11:27:09 +02:00
|
|
|
import { toEqualBuffer } from "./spec";
|
2022-07-26 03:40:32 +02:00
|
|
|
|
2022-03-28 16:00:42 +02:00
|
|
|
Object.defineProperty(window, "crypto", {
|
|
|
|
value: webcrypto,
|
|
|
|
});
|
2022-07-26 03:40:32 +02:00
|
|
|
|
|
|
|
// Add custom matchers
|
|
|
|
|
|
|
|
expect.extend({
|
|
|
|
toEqualBuffer: toEqualBuffer,
|
|
|
|
});
|
|
|
|
|
2023-08-04 04:13:33 +02:00
|
|
|
export interface CustomMatchers<R = unknown> {
|
2022-07-26 03:40:32 +02:00
|
|
|
toEqualBuffer(expected: Uint8Array | ArrayBuffer): R;
|
|
|
|
}
|