From 0f1211f2ce94d1c129a683b30d060345a63cdf54 Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 5 Jan 2021 17:42:29 -0800 Subject: [PATCH] test: provide more garbagey gzip data for zlib fail test --- test/unpack.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unpack.js b/test/unpack.js index f8cd43a9..425d4c6e 100644 --- a/test/unpack.js +++ b/test/unpack.js @@ -2508,8 +2508,8 @@ t.test('do not reuse hardlinks, only nlink=1 files', t => { t.end() }) -t.test('trying to unpack a javascript file should fail', t => { - const data = fs.readFileSync(__filename) +t.test('trying to unpack a non-zlib gzip file should fail', t => { + const data = Buffer.from('hello this is not gzip data') const dataGzip = Buffer.concat([Buffer.from([0x1f, 0x8b]), data]) const basedir = path.resolve(unpackdir, 'bad-archive') t.test('abort if gzip has an error', t => {