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

Commit 1f2d3a8

Browse files
test: fix encodeBmp equality checks (#489)
Co-authored-by: EscapedGibbon <[email protected]>
1 parent 7c00be1 commit 1f2d3a8

File tree

4 files changed

+6
-12
lines changed

4 files changed

+6
-12
lines changed

src/save/__tests__/encodeBmp.test.ts

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ test('encode 5x5 mask', () => {
1212
]);
1313
const mask = image.threshold({ threshold: 0.5 });
1414
const result = testUtils.loadBuffer('formats/bmp/5x5.bmp');
15-
const buffer = encodeBmp(mask).buffer;
15+
const buffer = encodeBmp(mask);
1616

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

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

33-
// TODO: change to `toStrictEqual`.
34-
// eslint-disable-next-line vitest/prefer-strict-equal
35-
expect(buffer).toEqual(result.buffer);
31+
expect(buffer).toStrictEqual(result);
3632
});
3733

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

47-
// TODO: change to `toStrictEqual`.
48-
// eslint-disable-next-line vitest/prefer-strict-equal
49-
expect(buffer).toEqual(result.buffer);
43+
expect(buffer).toStrictEqual(result);
5044
});
5145

5246
test('should throw error', () => {

test/img/formats/bmp/10x2.bmp

0 Bytes
Binary file not shown.

test/img/formats/bmp/5x5.bmp

0 Bytes
Binary file not shown.

test/img/formats/bmp/6x4.bmp

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)