Merge pull request #265 from joefitter/bugfix/conditional-coverage
dont run coverage if publishing
This commit is contained in:
@ -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 .",
|
||||||
|
@ -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)/,
|
test: /\.(ts)/,
|
||||||
include: path.resolve("src"),
|
include: path.resolve("src"),
|
||||||
loader: "istanbul-instrumenter-loader",
|
loader: "istanbul-instrumenter-loader",
|
||||||
enforce: "post",
|
enforce: "post",
|
||||||
exclude: [/node_modules/],
|
exclude: [/node_modules/],
|
||||||
},
|
}]
|
||||||
|
: []
|
||||||
|
)
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user