Skip to content

Commit

Permalink
Do not attempt to write snapshot file in runner
Browse files Browse the repository at this point in the history
The runner frequently has a very long snapshot filename, since it
includes all the CLI arguments, and people may run tap like
`tap lib/**/*.test.js` and pull in a lot of files for a large program.

Since the runner never has a snapshot to save, setting it in
writeSnapshot mode means that it will try to rm the file, resulting in
an ENAMETOOLONG error.

Close #567
  • Loading branch information
isaacs committed Jun 5, 2019
1 parent 2bfdd9e commit f6cc43a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ const stdinOnly = options => {
// to the reporter, so we don't get '/dev/stdin' in the suite list.
// We have to pause() before piping to switch streams2 into old-mode
const tap = require('../lib/tap.js')
tap.writeSnapshot = false
tap.stdinOnly()
makeReporter(tap, options)

Expand Down Expand Up @@ -665,6 +666,7 @@ const runTests = options => {
// At this point, we know we need to use the tap root,
// because there are 1 or more files to spawn.
const tap = require('../lib/tap.js')
tap.writeSnapshot = false
if (options.comments) {
const onComment = c => {
if (!c.match(/^# (time=[0-9\.]+m?s|Subtest(: .+)?)\n$/))
Expand Down

0 comments on commit f6cc43a

Please sign in to comment.