Skip to content

Commit a4ddf8d

Browse files
committed
Move mocha node test cli options into config file.
1 parent 43c20e8 commit a4ddf8d

File tree

9 files changed

+12
-10
lines changed

9 files changed

+12
-10
lines changed

config/mocha.node.opts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
# command lines will override their values specified here.
33
# See https://mochajs.org/#mochaopts for detailed usage of the mocha config file.
44

5-
# Node doesn't exit after mocha test completion. Supplying this flag for force exit.
5+
--require ts-node/register
6+
--timeout 5000
7+
--retries 5
68
--exit

packages/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test": "run-p test:browser test:node",
1717
"test:browser": "karma start --single-run",
1818
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
19-
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha test/**/*.test.* --compilers ts:ts-node/register/type-check --opts ../../config/mocha.node.opts",
19+
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts",
2020
"prepare": "npm run build"
2121
},
2222
"license": "Apache-2.0",

packages/database/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dev": "rollup -c -w",
1515
"test": "run-p test:browser test:node",
1616
"test:browser": "karma start --single-run",
17-
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --compilers ts:ts-node/register/type-check -r src/nodePatches.ts --retries 5 --timeout 5000 --opts ../../config/mocha.node.opts",
17+
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' -r src/nodePatches.ts --opts ../../config/mocha.node.opts",
1818
"prepare": "npm run build"
1919
},
2020
"license": "Apache-2.0",

packages/firestore/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"test:all": "run-p test:browser test:node",
1414
"test:browser": "karma start --single-run",
1515
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
16-
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require ts-node/register/type-check --require index.node.ts --retries 5 --timeout 5000 --opts ../../config/mocha.node.opts",
17-
"test:node:persistence": "USE_MOCK_PERSISTENCE=YES TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require ts-node/register/type-check --require index.node.ts --require test/util/node_persistence.ts --retries 5 --timeout 5000 --opts ../../config/mocha.node.opts",
16+
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require index.node.ts --opts ../../config/mocha.node.opts",
17+
"test:node:persistence": "USE_MOCK_PERSISTENCE=YES TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require index.node.ts --require test/util/node_persistence.ts --opts ../../config/mocha.node.opts",
1818
"prepare": "npm run build"
1919
},
2020
"main": "dist/index.node.cjs.js",

packages/functions/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "run-p test:browser test:node",
1616
"test:browser": "karma start --single-run",
1717
"test:browser:debug": "karma start --browsers=Chrome --auto-watch",
18-
"test:node": "nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require ts-node/register --require index.node.ts --retries 5 --timeout 5000 --opts ../../config/mocha.node.opts",
18+
"test:node": "nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require index.node.ts --opts ../../config/mocha.node.opts",
1919
"test:emulator": "env FIREBASE_FUNCTIONS_EMULATOR_ORIGIN=http://localhost:5005 run-p test:node",
2020
"prepare": "npm run build"
2121
},

packages/logger/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"test": "run-p test:browser test:node",
1515
"test:browser": "karma start --single-run",
1616
"test:browser:debug": "karma start --browsers Chrome --auto-watch",
17-
"test:node": "nyc --reporter lcovonly -- mocha test/**/*.test.* --compilers ts:ts-node/register --opts ../../config/mocha.node.opts",
17+
"test:node": "nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts",
1818
"prepare": "npm run build"
1919
},
2020
"license": "Apache-2.0",

packages/template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"dev": "rollup -c -w",
1616
"test": "run-p test:browser test:node",
1717
"test:browser": "karma start --single-run",
18-
"test:node": "nyc --reporter lcovonly -- mocha test/**/*.test.* --compilers ts:ts-node/register --opts ../../config/mocha.node.opts",
18+
"test:node": "nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts",
1919
"prepare": "npm run build"
2020
},
2121
"peerDependencies": {

packages/testing/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"build": "rollup -c",
1212
"dev": "rollup -c -w",
13-
"test": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --require ts-node/register/type-check --retries 5 --timeout 5000 --opts ../../config/mocha.node.opts",
13+
"test": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha 'test/{,!(browser)/**/}*.test.ts' --opts ../../config/mocha.node.opts",
1414
"prepare": "npm run build"
1515
},
1616
"license": "Apache-2.0",

packages/util/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"dev": "rollup -c -w",
1515
"test": "run-p test:browser test:node",
1616
"test:browser": "karma start --single-run",
17-
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha test/**/*.test.* --compilers ts:ts-node/register/type-check --opts ../../config/mocha.node.opts",
17+
"test:node": "TS_NODE_CACHE=NO nyc --reporter lcovonly -- mocha test/**/*.test.* --opts ../../config/mocha.node.opts",
1818
"prepare": "npm run build"
1919
},
2020
"license": "Apache-2.0",

0 commit comments

Comments
 (0)