Skip to content

Commit

Permalink
Clean up nyc output so Travis passes on node 6
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 19, 2018
1 parent 2292432 commit bd4de92
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
24 changes: 12 additions & 12 deletions tap-snapshots/test-run.js-TAP.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ ok 3 - 3.test.js # {time}
1..3
# {time}
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | 100 | 100 | 100 | 100 | |
ok.js | 100 | 100 | 100 | 100 | |
----------|----------|----------|----------|----------|----------------|
-|-|-|-|-|-|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
-|-|-|-|-|-|
All files | 100 | 100 | 100 | 100 | |
ok.js | 100 | 100 | 100 | 100 | |
-|-|-|-|-|-|
`

Expand All @@ -87,12 +87,12 @@ ok 2 - 2.test.js # {time}
1..2
# {time}
----------|----------|----------|----------|----------|----------------|
File | % Stmts | % Branch | % Funcs | % Lines |Uncovered Lines |
----------|----------|----------|----------|----------|----------------|
All files | 75 | 75 | 100 | 75 | |
ok.js | 75 | 75 | 100 | 75 | 6 |
----------|----------|----------|----------|----------|----------------|
-|-|-|-|-|-|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Lines |
-|-|-|-|-|-|
All files | 75 | 75 | 100 | 75 | |
ok.js | 75 | 75 | 100 | 75 | 6 |
-|-|-|-|-|-|
`

Expand Down
10 changes: 9 additions & 1 deletion test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@ delete process.env.TAP_BAIL
delete process.env.TAP_COLORS
delete process.env.TAP_TIMEOUT

const clean = require('./clean-stacks.js')
const cleanStacks = require('./clean-stacks.js')
// also clean up NYC output a bit, because the line lengths
// in the text report can vary on different platforms.
const clean = string => cleanStacks(string)
.replace(/uncovered line( #)?s/i, 'Uncovered Lines')
.replace(/ +\|/g, ' |')
.replace(/\| +/g, '| ')
.replace(/-+\|/g, '-|')
.replace(/\|-+/g, '|-')

const run = (args, options, cb) => {
if (options && options.env)
Expand Down

0 comments on commit bd4de92

Please sign in to comment.