Skip to content

Commit be496bb

Browse files
committed
chore: write tarball to testDir
the `C` parameter only informs tar where to read from, not where to write to, evidently
1 parent c31de22 commit be496bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/lib/utils/tar.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const path = require('node:path')
12
const t = require('tap')
23
const tar = require('tar')
34
const pack = require('libnpmpack')
@@ -163,13 +164,14 @@ t.test('should getContents of a tarball with a node_modules directory included',
163164
},
164165
})
165166

167+
const fileName = path.join(testDir, 'npm-example-v1.tgz')
166168
await tar.c({
167169
gzip: true,
168-
file: 'npm-example-v1.tgz',
170+
file: fileName,
169171
C: testDir,
170172
}, ['package'])
171173

172-
const tarball = await readFile(`npm-example-v1.tgz`)
174+
const tarball = await readFile(fileName)
173175

174176
const tarballContents = await getContents({
175177
name: 'my-cool-pkg',

0 commit comments

Comments
 (0)