Skip to content

Commit

Permalink
Merge pull request #164 from reg-viz/fix_buffer_in_test
Browse files Browse the repository at this point in the history
chore: Don't use legacy buffer constructor
  • Loading branch information
Quramy committed Mar 4, 2024
2 parents a0e5313 + fabd97d commit 96b965f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/expand.test.ts
Expand Up @@ -28,7 +28,7 @@ test("expand horizontal", async () => {
expect(dataList[1]).toBe(img2.data);
expect(dataList[0].length).toBe(width * height * 4);
const png = new PNG({ width, height });
png.data = new Buffer(dataList[0]);
png.data = Buffer.from(dataList[0]);
fs.writeFileSync(path.resolve(__dirname, "../test-images/expand_horizontal_generated.png"), PNG.sync.write(png));
});

Expand All @@ -42,6 +42,6 @@ test("expand vertical", async () => {
expect(dataList[1]).toBe(img2.data);
expect(dataList[0].length).toBe(width * height * 4);
const png = new PNG({ width, height });
png.data = new Buffer(dataList[0]);
png.data = Buffer.from(dataList[0]);
fs.writeFileSync(path.resolve(__dirname, "../test-images/expand_vertical_generated.png"), PNG.sync.write(png));
});

0 comments on commit 96b965f

Please sign in to comment.