-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: output cobertura report by default (#226)
skip unstable dts test case tempororily
- Loading branch information
Showing
6 changed files
with
22 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,31 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const assert = require('assert'); | ||
const coffee = require('coffee'); | ||
|
||
describe('test/node-test-cov.test.js', () => { | ||
const eggBin = require.resolve('../bin/egg-bin.js'); | ||
const cwd = path.join(__dirname, 'fixtures/node-test'); | ||
|
||
it('should run with node-test mode work', () => { | ||
return coffee.fork(eggBin, [ 'node-test-cov' ], { cwd }) | ||
beforeEach(() => fs.rmSync(path.join(cwd, 'coverage'), { force: true, recursive: true })); | ||
|
||
function assertCoverage(cwd) { | ||
assert.ok(fs.existsSync(path.join(cwd, 'coverage/coverage-final.json'))); | ||
assert.ok(fs.existsSync(path.join(cwd, 'coverage/coverage-summary.json'))); | ||
assert.ok(fs.existsSync(path.join(cwd, 'coverage/lcov-report/index.html'))); | ||
assert.ok(fs.existsSync(path.join(cwd, 'coverage/lcov.info'))); | ||
assert.ok(fs.existsSync(path.join(cwd, 'coverage/cobertura-coverage.xml'))); | ||
} | ||
|
||
it('should run with node-test mode work', async () => { | ||
await coffee.fork(eggBin, [ 'node-test-cov' ], { cwd }) | ||
.debug() | ||
.expect('stdout', /# tests 2/) | ||
.expect('stdout', /# pass 1/) | ||
.expect('stdout', /# fail 1/) | ||
.expect('stdout', /Statements {3}: 100% \( 3\/3 \)/) | ||
.expect('code', 1) | ||
.end(); | ||
assertCoverage(cwd); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters