mirror of
https://github.com/bitwarden/directory-connector
synced 2025-12-15 15:53:41 +00:00
Upgrade the jest test suite to match the clients (#379)
* Upgrade the jest test suite to match the clients * Update makeStaticByteArray
This commit is contained in:
25
jslib/common/spec/matchers/to-equal-buffer.spec.ts
Normal file
25
jslib/common/spec/matchers/to-equal-buffer.spec.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { makeStaticByteArray } from "../utils";
|
||||
|
||||
describe("toEqualBuffer custom matcher", () => {
|
||||
it("matches identical ArrayBuffers", () => {
|
||||
const array = makeStaticByteArray(10);
|
||||
expect(array.buffer).toEqualBuffer(array.buffer);
|
||||
});
|
||||
|
||||
it("matches an identical ArrayBuffer and Uint8Array", () => {
|
||||
const array = makeStaticByteArray(10);
|
||||
expect(array.buffer).toEqualBuffer(array);
|
||||
});
|
||||
|
||||
it("doesn't match different ArrayBuffers", () => {
|
||||
const array1 = makeStaticByteArray(10);
|
||||
const array2 = makeStaticByteArray(10, 11);
|
||||
expect(array1.buffer).not.toEqualBuffer(array2.buffer);
|
||||
});
|
||||
|
||||
it("doesn't match a different ArrayBuffer and Uint8Array", () => {
|
||||
const array1 = makeStaticByteArray(10);
|
||||
const array2 = makeStaticByteArray(10, 11);
|
||||
expect(array1.buffer).not.toEqualBuffer(array2);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user