mirror of
https://github.com/bitwarden/browser
synced 2024-12-21 07:27:23 +01:00
36b7d30804
* Change everything to Uint8Array related to https://github.com/jestjs/jest/issues/14379 * Work on failing type tests * Revert changes to custom matcher setup * Remove last BufferArrays from tests * Fix custom matcher type errors in vscode * Remove errant `.buffer` calls on Uint8Arrays * Encryption Pair should serialize Array Buffer and Uint8Array * Fix EncArrayBuffer encryption --------- Co-authored-by: Thomas Rittson <trittson@bitwarden.com>
18 lines
327 B
TypeScript
18 lines
327 B
TypeScript
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;
|
|
}
|