Skip to content
This repository was archived by the owner on Jul 26, 2025. It is now read-only.

test: fix encodeBmp equality checks #489

Merged
merged 2 commits into from
Jul 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions src/save/__tests__/encodeBmp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ test('encode 5x5 mask', () => {
]);
const mask = image.threshold({ threshold: 0.5 });
const result = testUtils.loadBuffer('formats/bmp/5x5.bmp');
const buffer = encodeBmp(mask).buffer;
const buffer = encodeBmp(mask);

// TODO: change to `toStrictEqual`.
// eslint-disable-next-line vitest/prefer-strict-equal
expect(buffer).toEqual(result.buffer);
expect(buffer).toStrictEqual(result);
});

test('encode 6x4 mask', () => {
Expand All @@ -28,11 +26,9 @@ test('encode 6x4 mask', () => {
]);
const mask = image.threshold({ threshold: 0.5 });
const result = testUtils.loadBuffer('formats/bmp/6x4.bmp');
const buffer = encodeBmp(mask).buffer;
const buffer = encodeBmp(mask);

// TODO: change to `toStrictEqual`.
// eslint-disable-next-line vitest/prefer-strict-equal
expect(buffer).toEqual(result.buffer);
expect(buffer).toStrictEqual(result);
});

test('encode 10x2 mask', () => {
Expand All @@ -42,11 +38,9 @@ test('encode 10x2 mask', () => {
]);
const mask = image.threshold({ threshold: 0.5 });
const result = testUtils.loadBuffer('formats/bmp/10x2.bmp');
const buffer = encodeBmp(mask).buffer;
const buffer = encodeBmp(mask);

// TODO: change to `toStrictEqual`.
// eslint-disable-next-line vitest/prefer-strict-equal
expect(buffer).toEqual(result.buffer);
expect(buffer).toStrictEqual(result);
});

test('should throw error', () => {
Expand Down
Binary file modified test/img/formats/bmp/10x2.bmp
Binary file not shown.
Binary file modified test/img/formats/bmp/5x5.bmp
Binary file not shown.
Binary file modified test/img/formats/bmp/6x4.bmp
Binary file not shown.
Loading