Skip to content

Commit

Permalink
fix: make tests run on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
laggingreflex committed Sep 11, 2018
1 parent df6084b commit a19dce5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"url": "[email protected]:bcoe/c8.git"
},
"scripts": {
"test": "./bin/c8.js --reporter=html --reporter=text mocha ./test/*.js",
"test": "node ./bin/c8.js --reporter=html --reporter=text mocha ./test/*.js",
"posttest": "standard",
"coverage": "./bin/c8.js report --reporter=text-lcov | coveralls",
"release": "standard-version"
Expand Down
11 changes: 7 additions & 4 deletions test/integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

const { spawnSync } = require('child_process')
const c8Path = require.resolve('../bin/c8')
const nodePath = process.execPath

require('chai').should()

describe('c8', () => {
it('reports coverage for script that exits normally', () => {
const { output } = spawnSync(c8Path, [
const { output } = spawnSync(nodePath, [
c8Path,
'--exclude="test/*.js"',
process.execPath,
nodePath,
require.resolve('./fixtures/normal')
])
output.toString('utf8').should.include(`
Expand All @@ -23,9 +25,10 @@ All files | 91.18 | 88.89 | 0 | 91.18 | |
})

it('merges reports from subprocesses together', () => {
const { output } = spawnSync(c8Path, [
const { output } = spawnSync(nodePath, [
c8Path,
'--exclude="test/*.js"',
process.execPath,
nodePath,
require.resolve('./fixtures/multiple-spawn')
])
output.toString('utf8').should.include(`
Expand Down

0 comments on commit a19dce5

Please sign in to comment.