dont run coverage if publishing

This commit is contained in:
Joe Fitter
2019-02-08 12:04:17 +00:00
parent 83a7f4664d
commit a6077b8f16
2 changed files with 12 additions and 9 deletions

View File

@ -8,7 +8,7 @@
"test": "mocha-webpack \"src/**/*.ts\"", "test": "mocha-webpack \"src/**/*.ts\"",
"test.coverage": "nyc npm test", "test.coverage": "nyc npm test",
"test.watch": "npm test -- --watch", "test.watch": "npm test -- --watch",
"prepublishOnly": "npm run build", "prepublishOnly": "npm run build --production",
"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 .",

View File

@ -22,14 +22,17 @@ module.exports = {
test: /\.ts$/, test: /\.ts$/,
loaders: ["awesome-typescript-loader"], loaders: ["awesome-typescript-loader"],
}, },
{ // For coverage testing
// For coverage testing ...(process.env.NODE_ENV !== "production"
test: /\.(ts)/, ? [{
include: path.resolve("src"), test: /\.(ts)/,
loader: "istanbul-instrumenter-loader", include: path.resolve("src"),
enforce: "post", loader: "istanbul-instrumenter-loader",
exclude: [/node_modules/], enforce: "post",
}, exclude: [/node_modules/],
}]
: []
)
], ],
}, },