Skip to content

Commit 1f6499c

Browse files
merlinnotthechenky
authored andcommitted
Introduce Mocha configuration file (#515)
* Introduce mocha configuration file * Reformat * Remove an empty file
1 parent 273c5ff commit 1f6499c

File tree

4 files changed

+22
-50
lines changed

4 files changed

+22
-50
lines changed

.mocharc.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
exit: true
2+
extension:
3+
- ts
4+
file:
5+
- mocha/setup.ts
6+
package: ./package.json
7+
reporter: spec
8+
require:
9+
- 'ts-node/register'
10+
spec: spec/**/*.spec.ts

mocha/setup.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import * as chai from 'chai';
2+
import * as chaiAsPromised from 'chai-as-promised';
3+
import * as nock from 'nock';
4+
5+
chai.use(chaiAsPromised);
6+
7+
nock.disableNetConnect();

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,21 @@
1818
},
1919
"license": "MIT",
2020
"author": "Firebase Team",
21-
"files": ["lib"],
21+
"files": [
22+
"lib"
23+
],
2224
"main": "lib/index.js",
2325
"types": "lib/index.d.ts",
2426
"scripts": {
27+
"apidocs": "node docgen/generate-docs.js",
2528
"build:pack": "rm -rf lib && npm install && tsc -p tsconfig.release.json && npm pack",
2629
"build:release": "npm install --production && npm install typescript firebase-admin && tsc -p tsconfig.release.json",
2730
"build": "tsc -p tsconfig.release.json",
2831
"format": "prettier --check '**/*.{json,md,ts,yml,yaml}'",
2932
"format:fix": "prettier --write '**/*.{json,md,ts,yml,yaml}'",
3033
"lint": "tslint --config tslint.json --project tsconfig.json ",
3134
"lint:fix": "tslint --config tslint.json --fix --project tsconfig.json",
32-
"test": "mocha -r ts-node/register ./spec/index.spec.ts",
33-
"apidocs": "node docgen/generate-docs.js"
35+
"test": "mocha"
3436
},
3537
"dependencies": {
3638
"@types/express": "^4.17.0",

spec/index.spec.ts

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)