From 8daf397e69b743979b03d3d387fec5f34ca15ab0 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Fri, 29 Mar 2024 10:53:02 +0100 Subject: [PATCH] fixup Signed-off-by: Matteo Collina --- test/issue-288.test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/issue-288.test.js b/test/issue-288.test.js index a42dafb..0e584bc 100644 --- a/test/issue-288.test.js +++ b/test/issue-288.test.js @@ -3,7 +3,7 @@ const { test } = require('tap') const Fastify = require('fastify') const fastifyCompress = require('..') -const fsPromises = require("fs").promises +const fsPromises = require('fs').promises const { join } = require('path') const { fetch } = require('undici') @@ -14,17 +14,17 @@ test('should not corrupt the file content', async (t) => { fastify.register(async (instance, opts) => { await fastify.register(fastifyCompress) instance.get('/issue', async (req, reply) => { - const longStringWithEmoji = await fsPromises.readFile(join(__dirname, "./test.txt"), "utf-8"); + const longStringWithEmoji = await fsPromises.readFile(join(__dirname, './test.txt'), 'utf-8') - return longStringWithEmoji // <--- the file content is corrupt + return longStringWithEmoji // <--- the file content is corrupt // search for "hydra.alibaba.com" will see 2 wired question marks instead of emoji }) }) fastify.get('/good', async (req, reply) => { - const longStringWithEmoji = await fsPromises.readFile(join(__dirname, "./test.txt"), "utf-8"); + const longStringWithEmoji = await fsPromises.readFile(join(__dirname, './test.txt'), 'utf-8') - return longStringWithEmoji // <--- the file content is ok + return longStringWithEmoji // <--- the file content is ok // search for "hydra.alibaba.com" will see emoji })