Skip to content

Commit 973906e

Browse files
committed
chore: use jest instead of mocha
1 parent 1b7754c commit 973906e

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

package.json

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,33 @@
2020
"prepublishOnly": "npm run clean && npm run test && npm run build",
2121
"clean": "rm -rf lib",
2222
"build": "tsc -p src",
23-
"dev": "npm run test:unit -- -w",
23+
"dev": "jest --watch",
2424
"lint": "tslint -p . && prettier --list-different \"{src,scripts,test}/**/*.{js,ts}\"",
2525
"format": "prettier --write \"{src,scripts,test}/**/*.{js,ts}\"",
2626
"test": "npm run lint && npm run test:unit",
27-
"test:unit": "mocha --require espower-typescript/guess test/**/*.ts"
27+
"test:unit": "jest"
28+
},
29+
"jest": {
30+
"transform": {
31+
"^.+\\.(js|ts)$": "ts-jest"
32+
},
33+
"testRegex": "/test/.*\\.spec\\.(js|ts)$",
34+
"moduleFileExtensions": [
35+
"ts",
36+
"js",
37+
"json"
38+
],
39+
"globals": {
40+
"ts-jest": {
41+
"tsConfigFile": "test/tsconfig.json"
42+
}
43+
}
2844
},
2945
"devDependencies": {
30-
"@types/mocha": "^2.2.48",
31-
"@types/power-assert": "1.4.29",
32-
"espower-typescript": "^8.1.3",
33-
"mocha": "^5.0.1",
34-
"power-assert": "^1.4.4",
46+
"@types/jest": "^22.1.3",
47+
"jest": "^22.4.2",
3548
"prettier": "1.11.0",
49+
"ts-jest": "^22.4.0",
3650
"tslint": "^5.9.1",
3751
"tslint-config-ktsn": "^2.1.0",
3852
"tslint-config-prettier": "^1.9.0",

test/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"extends": "../tsconfig.json",
33
"compilerOptions": {
4-
"sourceMap": true
4+
"sourceMap": true,
5+
"outDir": ".tmp"
56
}
67
}

0 commit comments

Comments
 (0)