Add nyc support
This commit is contained in:
7
.gitignore
vendored
7
.gitignore
vendored
@ -58,5 +58,8 @@ yarn.lock
|
|||||||
# Documents
|
# Documents
|
||||||
My Document.docx
|
My Document.docx
|
||||||
|
|
||||||
# Temporary folder
|
# Temporary folder
|
||||||
tmp
|
tmp
|
||||||
|
|
||||||
|
# nyc
|
||||||
|
.nyc_output
|
||||||
|
26
.nycrc
Normal file
26
.nycrc
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"check-coverage": true,
|
||||||
|
"lines": 84.56,
|
||||||
|
"functions": 77.50,
|
||||||
|
"branches": 71.40,
|
||||||
|
"statements": 84.30,
|
||||||
|
"include": [
|
||||||
|
"src/**/*.ts"
|
||||||
|
],
|
||||||
|
"exclude": [
|
||||||
|
"build/",
|
||||||
|
"src/**/*.spec.ts"
|
||||||
|
],
|
||||||
|
"reporter": [
|
||||||
|
"lcov",
|
||||||
|
"text",
|
||||||
|
"json"
|
||||||
|
],
|
||||||
|
"extension": [
|
||||||
|
".ts"
|
||||||
|
],
|
||||||
|
"cache": true,
|
||||||
|
"all": true,
|
||||||
|
"instrument": false,
|
||||||
|
"sourceMap": true
|
||||||
|
}
|
@ -4,7 +4,6 @@ node_js:
|
|||||||
install:
|
install:
|
||||||
- npm install
|
- npm install
|
||||||
- npm install -g codecov
|
- npm install -g codecov
|
||||||
- npm install -g nyc
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm test
|
- npm test
|
||||||
@ -50,7 +49,7 @@ after_success:
|
|||||||
- npm run typedoc
|
- npm run typedoc
|
||||||
- echo "docx.js.org" > docs/.nojekyll
|
- echo "docx.js.org" > docs/.nojekyll
|
||||||
- echo "docx.js.org" > docs/CNAME
|
- echo "docx.js.org" > docs/CNAME
|
||||||
- nyc report --reporter=json
|
- npm run cover
|
||||||
- codecov
|
- codecov
|
||||||
deploy:
|
deploy:
|
||||||
provider: pages
|
provider: pages
|
||||||
|
10
package.json
10
package.json
@ -6,19 +6,19 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"pretest": "rimraf ./build",
|
"pretest": "rimraf ./build",
|
||||||
"test": "mocha-webpack \"src/**/*.ts\"",
|
"test": "mocha-webpack \"src/**/*.ts\"",
|
||||||
"test-watch": "mocha-webpack \"src/**/*.ts\" --watch",
|
"test.watch": "npm test -- --watch",
|
||||||
"prepublishOnly": "npm run build",
|
"prepublishOnly": "npm run build",
|
||||||
"lint": "tslint --project .",
|
"lint": "tslint --project .",
|
||||||
"build": "npm run webpack && npm run fix-types",
|
"build": "npm run webpack && npm run fix-types",
|
||||||
"tsc": "rimraf ./build && tsc -p .",
|
"tsc": "rimraf ./build && tsc -p .",
|
||||||
"webpack": "rimraf ./build && webpack",
|
"webpack": "rimraf ./build && webpack",
|
||||||
"build.web": "webpack --config webpack.web.config.js",
|
|
||||||
"demo": "npm run build && npm run ts-node ./demo",
|
"demo": "npm run build && npm run ts-node ./demo",
|
||||||
"typedoc": "typedoc src/index.ts",
|
"typedoc": "typedoc src/index.ts",
|
||||||
"style": "prettier -l \"src/**/*.ts\"",
|
"style": "prettier -l \"src/**/*.ts\"",
|
||||||
"style.fix": "prettier \"src/**/*.ts\" --write",
|
"style.fix": "npm run style -- --write",
|
||||||
"fix-types": "node types-absolute-fixer.js",
|
"fix-types": "node types-absolute-fixer.js",
|
||||||
"ts-node": "ts-node"
|
"ts-node": "ts-node",
|
||||||
|
"cover": "nyc npm run test"
|
||||||
},
|
},
|
||||||
"pre-commit": [
|
"pre-commit": [
|
||||||
"style",
|
"style",
|
||||||
@ -67,9 +67,11 @@
|
|||||||
"awesome-typescript-loader": "^3.4.1",
|
"awesome-typescript-loader": "^3.4.1",
|
||||||
"chai": "^3.5.0",
|
"chai": "^3.5.0",
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
|
"istanbul-instrumenter-loader": "^3.0.1",
|
||||||
"jszip": "^3.1.5",
|
"jszip": "^3.1.5",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
"mocha-webpack": "^1.0.1",
|
"mocha-webpack": "^1.0.1",
|
||||||
|
"nyc": "^13.1.0",
|
||||||
"pre-commit": "^1.2.2",
|
"pre-commit": "^1.2.2",
|
||||||
"prettier": "^1.12.1",
|
"prettier": "^1.12.1",
|
||||||
"prompt": "^1.0.0",
|
"prompt": "^1.0.0",
|
||||||
|
@ -20,6 +20,14 @@ module.exports = {
|
|||||||
test: /\.ts$/,
|
test: /\.ts$/,
|
||||||
loaders: ["awesome-typescript-loader"],
|
loaders: ["awesome-typescript-loader"],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
// For coverage testing
|
||||||
|
test: /\.(ts)/,
|
||||||
|
include: path.resolve("src"),
|
||||||
|
loader: "istanbul-instrumenter-loader",
|
||||||
|
enforce: "post",
|
||||||
|
exclude: [/node_modules/],
|
||||||
|
}
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user