Skip to content

Commit

Permalink
chore(test): Avoid spurious failures packing node_modules/.cache
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Aug 26, 2021
1 parent 24b8bda commit a9d9b05
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ t.test('gzipped tarball that makes some drain/resume stuff', t => {
const cwd = path.dirname(__dirname)
const out = path.resolve(dir, 'package.tgz')

c({ z: true, C: cwd }, ['node_modules'])
// don't include node_modules/.cache, since that gets written to
// by nyc during tests, and can result in spurious errors.
const entries = fs.readdirSync(`${cwd}/node_modules`)
.filter(e => !/^\./.test(e))
.map(e => `node_modules/${e}`)

c({ z: true, C: cwd }, entries)
.pipe(fs.createWriteStream(out))
.on('finish', _ => {
const child = spawn('tar', ['tf', out], {
Expand Down

0 comments on commit a9d9b05

Please sign in to comment.