Skip to content

Commit d449611

Browse files
committed
feat: simplify mocha config
1 parent 5caa1e4 commit d449611

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/cli.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ async function main(): Promise<void> {
234234
main: 'dist/index.js',
235235
types: 'dist/index.d.ts',
236236
scripts: {
237-
...(hasTests ? { test: 'mocha --require ts-node/register "src/**/*.test.ts"' } : {}),
237+
...(hasTests ? { test: 'nyc mocha' } : {}),
238238
'semantic-release': 'semantic-release',
239239
prettier: "prettier '**/{*.{js?(on),ts?(x),scss},.*.js?(on)}' --write --list-different",
240240
'prettier-check': 'npm run prettier -- --write=false',
@@ -257,6 +257,10 @@ async function main(): Promise<void> {
257257
exclude: ['**/*.test.ts?(x)'],
258258
extension: ['.tsx', '.ts'],
259259
},
260+
mocha: {
261+
require: 'ts-node/register',
262+
spec: 'src/**/*.test.ts',
263+
},
260264
}
261265
: {}),
262266
}
@@ -288,7 +292,7 @@ async function main(): Promise<void> {
288292
'@sourcegraph/tslint-config',
289293
'@sourcegraph/tsconfig',
290294
'@sourcegraph/prettierrc',
291-
...(hasTests ? ['mocha', 'nyc'] : []),
295+
...(hasTests ? ['mocha', 'nyc', 'ts-node', '@types/mocha', '@types/node'] : []),
292296
],
293297
{ stdio: 'inherit' }
294298
)

0 commit comments

Comments
 (0)