Use a configuration file for mocha ut
authorJérôme Benoit <jerome.benoit@sap.com>
Thu, 18 Feb 2021 16:21:36 +0000 (17:21 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Thu, 18 Feb 2021 16:21:36 +0000 (17:21 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.mocharc.json [new file with mode: 0644]
package.json

diff --git a/.mocharc.json b/.mocharc.json
new file mode 100644 (file)
index 0000000..aa7764d
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "diff": true,
+  "package": "./package.json",
+  "timeout": 20000,
+  "full-trace": true,
+  "exit": true,
+  "require": ["source-map-support/register"]
+}
index 33b1ebe9c1dc880aedbc7e032917625853b2b5f6..02f1a52b94d5fb5c92089904f2aa36dc83516343 100644 (file)
@@ -9,9 +9,9 @@
     "benchmark": "npm run build && node -r source-map-support/register benchmarks/bench.js",
     "benchmark:debug": "npm run build && node -r source-map-support/register --inspect benchmarks/bench.js",
     "benchmark:prod": "npm run build:prod && node -r source-map-support/register benchmarks/bench.js",
-    "test": "npm run build && nyc mocha -r source-map-support/register --exit --timeout 20000 --parallel 'tests/**/*.test.js'",
-    "test:debug": "npm run build && mocha -r source-map-support/register --inspect --exit --timeout 20000 'tests/**/*.test.js'",
-    "test:prod": "npm run build:prod && nyc mocha -r source-map-support/register --exit --timeout 20000 'tests/**/*.test.js'",
+    "test": "npm run build && nyc mocha --parallel 'tests/**/*.test.js'",
+    "test:debug": "npm run build && mocha --inspect 'tests/**/*.test.js'",
+    "test:prod": "npm run build:prod && nyc mocha --parallel 'tests/**/*.test.js'",
     "sonar": "sonar-scanner",
     "coverage": "nyc report --reporter=lcov",
     "coverage:html": "nyc report --reporter=html",