feat: simplify nyc config
MODIFY
src/generators/app.ts
src/generators/app.ts
@@ -269,7 +269,7 @@ class App extends Generator {
this.pjson.scripts.posttest = 'eslint .'
}
if (this.mocha) {
- this.pjson.scripts.test = `nyc mocha --forbid-only "test/**/*.test.${this._ext}"`
+ this.pjson.scripts.test = `nyc ${this.ts ? '--extension .ts ' : ''}mocha --forbid-only "test/**/*.test.${this._ext}"`
} else {
this.pjson.scripts.test = 'echo NO TESTS'
}
@@ -343,7 +343,6 @@ class App extends Generator {
this.fs.copyTpl(this.templatePath('tsconfig.json'), this.destinationPath('tsconfig.json'), this)
if (this.mocha) {
this.fs.copyTpl(this.templatePath('test/tsconfig.json'), this.destinationPath('test/tsconfig.json'), this)
- this.fs.copyTpl(this.templatePath('nycrc'), this.destinationPath('.nycrc'), this)
}
} else {
this.fs.copyTpl(this.templatePath('eslintrc'), this.destinationPath('.eslintrc'), this)

DELETE
templates/nycrc
-{
- "extension": [
- ".ts"
- ],
- "include": [
- "src/**/*.ts"
- ],
- "exclude": [
- "**/*.d.ts"
- ],
- "all": true
-}

feat: simplify nyc config