From 8cd81396b8a0fa0399e22a7adf474ad74088540d Mon Sep 17 00:00:00 2001 From: isaacs Date: Fri, 12 May 2023 14:37:36 -0700 Subject: [PATCH] move mutateFS reset out of t.teardown Not sure why this was failing on my system, but this fixes it. --- test/unpack.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/unpack.js b/test/unpack.js index 2d75c946..399ae0e6 100644 --- a/test/unpack.js +++ b/test/unpack.js @@ -514,7 +514,8 @@ t.test('symlink in dir path', { t.test('clobber through symlink with busted unlink', t => { const poop = new Error('poop') - t.teardown(mutateFS.fail('unlink', poop)) + // for some reason, resetting fs.unlink in the teardown was breaking + const reset = mutateFS.fail('unlink', poop) const warnings = [] const u = new Unpack({ cwd: dir, @@ -523,6 +524,7 @@ t.test('symlink in dir path', { }) u.on('close', _ => { t.same(warnings, [['TAR_ENTRY_ERROR', 'poop', poop]]) + reset() t.end() }) u.end(data)