Skip to content

Commit a9d9b05

Browse files
committed
chore(test): Avoid spurious failures packing node_modules/.cache
1 parent 24b8bda commit a9d9b05

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/create.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,13 @@ t.test('gzipped tarball that makes some drain/resume stuff', t => {
154154
const cwd = path.dirname(__dirname)
155155
const out = path.resolve(dir, 'package.tgz')
156156

157-
c({ z: true, C: cwd }, ['node_modules'])
157+
// don't include node_modules/.cache, since that gets written to
158+
// by nyc during tests, and can result in spurious errors.
159+
const entries = fs.readdirSync(`${cwd}/node_modules`)
160+
.filter(e => !/^\./.test(e))
161+
.map(e => `node_modules/${e}`)
162+
163+
c({ z: true, C: cwd }, entries)
158164
.pipe(fs.createWriteStream(out))
159165
.on('finish', _ => {
160166
const child = spawn('tar', ['tf', out], {

0 commit comments

Comments
 (0)