Skip to content

Commit aa3de34

Browse files
committed
Moved all mocha configs into a .mocharc.yml
1 parent 1e9f73f commit aa3de34

File tree

4 files changed

+25
-24
lines changed

4 files changed

+25
-24
lines changed

.mocharc.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# mocha settings
2+
require:
3+
- ts-node/register
4+
- source-map-support/register
5+
recursive: true
6+
color: true
7+
extension:
8+
- ts
9+
- test.ts

.nycrc.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ extends: "@istanbuljs/nyc-config-typescript"
33
all: true
44

55
reporter:
6-
- html
7-
- lcovonly
8-
- clover
9-
# those 2 are for commandline outputs
10-
- text
11-
- text-summary
6+
- html
7+
- lcovonly
8+
- clover
9+
# those 2 are for commandline outputs
10+
- text
11+
- text-summary
1212
report-dir: coverage
1313

1414
# Coverage gates

.vscode/launch.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@
2121
"request": "launch",
2222
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
2323
"args": [
24-
"--no-timeouts", "--colors",
25-
// according to https://github.com/istanbuljs/istanbuljs/tree/master/packages/nyc-config-typescript
26-
"--require", "ts-node/register", "--recursive",
27-
"--exit",
28-
"${workspaceFolder}/src/**/*.test.ts",
29-
"${workspaceFolder}/test/**/*.ts"
24+
"${workspaceFolder}/src",
25+
"${workspaceFolder}/test"
3026
],
3127
"internalConsoleOptions": "openOnSessionStart"
3228
},
@@ -36,10 +32,6 @@
3632
"request": "launch",
3733
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
3834
"args": [
39-
"--no-timeouts", "--colors",
40-
// according to https://github.com/istanbuljs/istanbuljs/tree/master/packages/nyc-config-typescript
41-
"--require", "ts-node/register", "--recursive",
42-
"--exit",
4335
"${workspaceFolder}/**/${fileBasenameNoExtension}.ts"
4436
],
4537
"internalConsoleOptions": "openOnSessionStart"

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66
"scripts": {
77
"purge": "rm -rf node_modules package-lock.json && npm run clean",
88
"clean": "rm -rf build .nyc_output coverage",
9-
"lint": "npx eslint src",
10-
"build": "npm run clean && npm run lint && npx tsc -p .",
9+
"lint": "eslint src",
10+
"build": "npm run clean && npm run lint && tsc -p .",
1111
"start": "npm run build && node build/app.js",
12-
"test": "npm run lint && nyc npx mocha src/**/*.test.ts test/**/*.ts --exit --require ts-node/register --require source-map-support/register --recursive",
12+
"test": "npm run lint && nyc mocha src test",
1313
"docker": "docker build -t typescript-node-template ."
1414
},
1515
"repository": {
1616
"type": "git",
1717
"url": "git+https://github.com/Flowkap/typescript-node-template.git"
1818
},
1919
"keywords": [
20-
"node",
21-
"node.js",
22-
"typescript",
23-
"ts",
20+
"node", "node.js",
21+
"typescript", "ts",
2422
"service",
25-
"template"
23+
"template",
24+
"mocha", "chai", "nyc",
25+
"ts-node", "sinon", "eslint", "sonarts"
2626
],
2727
"author": "flowkap",
2828
"license": "MIT",

0 commit comments

Comments
 (0)