mocha: move spec to invocation

If we specify the spec in the config file, we can't manually
specify a specific test file from the cli.

This is annoying, as the alternative is copying out the full
package.json blurb into the shell.

Rather, give the spec in the invocation and add a helper
that makes testing a specific file simple.

With this `yarn test:nospec test/plugins/link.ts` will only run
tests within that file
This commit is contained in:
Reto Brunner 2024-01-27 15:34:13 +01:00
parent d4c77c74f6
commit 646bafab99
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,8 @@
"lint": "run-p --aggregate-output --continue-on-error lint:*", "lint": "run-p --aggregate-output --continue-on-error lint:*",
"start": "node index start", "start": "node index start",
"test": "run-p --aggregate-output --continue-on-error lint:* test:*", "test": "run-p --aggregate-output --continue-on-error lint:* test:*",
"test:mocha": "webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.yml", "test:mocha": "webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.yml 'test/**/*.ts'",
"test:nospec": "webpack --mode=development && cross-env NODE_ENV=test TS_NODE_PROJECT='./test/tsconfig.json' mocha --config=test/.mocharc.yml",
"watch": "webpack --watch" "watch": "webpack --watch"
}, },
"keywords": [ "keywords": [

View file

@ -2,7 +2,6 @@ color: true
check-leaks: true check-leaks: true
recursive: true recursive: true
reporter: dot reporter: dot
spec: "test/**/*.ts"
ignore: "test/client/**" ignore: "test/client/**"
extension: ["ts", "js"] extension: ["ts", "js"]
require: require: