Skip to content

Commit d48fe79

Browse files
committed
chore: normalize mocha configs
- Sorted the JSON - Added a `$schema` ref - Use `require: ts-node/register` here - Remove `require: ts-node/register` from scripts in `package.json`
1 parent 56813c0 commit d48fe79

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

.config/mocha.fast.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"$schema": "https://json.schemastore.org/mocharc.json",
3-
"timeout": 5000,
4-
"spec": ["src/test/**/*.test.ts"],
53
"exclude": ["src/test/packages/**", "src/test/slow/**"],
6-
"watch-files": ["src/**/*.ts"],
7-
"extension": ["ts", "tsx"]
4+
"extension": ["ts", "tsx"],
5+
"require": ["ts-node/register"],
6+
"spec": ["src/test/**/*.test.ts"],
7+
"timeout": 5000,
8+
"watch-files": ["src/**/*.ts"]
89
}

.config/mocha.full.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
2+
"$schema": "https://json.schemastore.org/mocharc.json",
23
"timeout": 0,
34
"spec": "src/test/**/*.test.ts",
4-
"exclude": ["src/test/packages/**"]
5+
"exclude": ["src/test/packages/**"],
6+
"require": ["ts-node/register"]
57
}

.config/mocha.test-explorer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
2+
"$schema": "https://json.schemastore.org/mocharc.json",
23
"extension": ["ts"],
4+
"ignore": ["src/test/slow/**", "src/test/packages/**"],
35
"package": "./package.json",
46
"require": "ts-node/register",
57
"slow": 500,
68
"spec": ["src/**/*.test.ts"],
7-
"ignore": ["src/test/slow/**", "src/test/packages/**"],
89
"timeout": 0,
910
"watch-files": ["src/**/*.ts"]
1011
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@
6262
"/tsdoc.json"
6363
],
6464
"scripts": {
65-
"test": "mocha -r ts-node/register --config .config/mocha.fast.json",
66-
"test:cov": "c8 mocha -r ts-node/register --config .config/mocha.fast.json",
65+
"test": "mocha --config .config/mocha.fast.json",
66+
"test:cov": "c8 mocha --config .config/mocha.fast.json",
6767
"doc:c": "node bin/typedoc --tsconfig src/test/converter/tsconfig.json",
6868
"doc:c2": "node bin/typedoc --tsconfig src/test/converter2/tsconfig.json",
69-
"test:full": "c8 mocha -r ts-node/register --config .config/mocha.full.json",
69+
"test:full": "c8 mocha --config .config/mocha.full.json",
7070
"test:visual": "ts-node ./src/test/capture-screenshots.ts && ./scripts/compare_screenshots.sh",
7171
"test:visual:accept": "node scripts/accept_visual_regression.js",
7272
"rebuild_specs": "node scripts/rebuild_specs.js",

0 commit comments

Comments
 (0)