Skip to content

Commit

Permalink
fix: remove ts extensions by default (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
whxaxes authored and popomore committed Mar 31, 2018
1 parent 6894b25 commit 1c860a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
6 changes: 2 additions & 4 deletions lib/cmd/cov.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,11 @@ class CovCommand extends Command {
'-r', 'json-summary',
'-r', 'json',
'-r', 'lcov',
'--extension', '.ts',
];

// typescript support
if (context.typescript) {
covArgs.push('--extension');
covArgs.push('.ts');
if (context.argv.typescript) {
covArgs.push('--extension', '.ts');
this.addExclude('typings/');
this.addExclude('**/*.d.ts');
}
Expand Down
5 changes: 4 additions & 1 deletion test/fixtures/example-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"name": "example-ts"
"name": "example-ts",
"egg": {
"typescript": true
}
}
2 changes: 1 addition & 1 deletion test/ts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('test/ts.test.js', () => {

it('should cov app', () => {
return coffee.fork(eggBin, [ 'cov', '--ts' ], { cwd })
.debug()
// .debug()
.expect('stdout', /hi, egg, 123456/)
.expect('stdout', process.env.NYC_ROOT_ID ? /Coverage summary/ : /Statements.*100%/)
.expect('code', 0)
Expand Down

0 comments on commit 1c860a9

Please sign in to comment.