Skip to content

Commit c21e7a7

Browse files
Skip npm tests on Windows due to a bug in nyc (istanbuljs/nyc#760)
1 parent b931677 commit c21e7a7

File tree

2 files changed

+11
-21
lines changed

2 files changed

+11
-21
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ language: node_js
77

88
node_js:
99
- 10
10-
# - 8
11-
# - 6
10+
- 8
11+
- 6
1212

1313
os:
14-
# - linux
15-
# - osx
14+
- linux
15+
- osx
1616
- windows
1717

18-
script: npm run coverage
18+
script: npm run lint && npm run coverage
1919

2020
after_success:
2121
# send code-coverage data to Coveralls

test/specs/version-hooks.spec.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,12 @@ const chai = require("chai");
1010

1111
chai.should();
1212

13-
describe.only("npm version hooks", () => {
14-
before("Delete npm.cmd from node_modules on Windows", () => {
15-
// https://github.com/istanbuljs/nyc/issues/760
16-
if (process.platform === "win32") {
17-
let npmNames = ["npm", "npm.js", "npm.cmd", "npm-cli", "npm-cli.js", "npm-cli.cmd"];
18-
for (let npmName of npmNames) {
19-
try {
20-
fs.unlinkSync(path.join("node_modules", "npm", "bin", npmName));
21-
console.log(`Deleting ${npmName}: SUCCESS`);
22-
}
23-
catch (error) {
24-
console.log(`Deleting ${npmName}: ${error.message}`);
25-
}
26-
}
27-
}
28-
});
13+
describe("npm version hooks", () => {
14+
if (process.platform === "win32" && process.env.CI) {
15+
// Spawning NPM fails on Windows due to a bug in NYC (actually in its dependency, spawn-wrap)
16+
// So skip these tests until this bug is fixed: https://github.com/istanbuljs/nyc/issues/760
17+
return;
18+
}
2919

3020
it("should run the preversion script before updating the version number", () => {
3121
files.create("package.json", {

0 commit comments

Comments
 (0)