Skip to content

Commit 328d345

Browse files
committed
test: support node 4
1 parent bcfdec3 commit 328d345

File tree

3 files changed

+33
-29
lines changed

3 files changed

+33
-29
lines changed

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"npmupdate": "bin/update.js"
1616
},
1717
"scripts": {
18-
"test": "mocha -r thunk-mocha -r intelli-espower-loader -t 200000 test/*.test.js",
19-
"test-cov": "istanbul cover --report none --print none node_modules/mocha/bin/_mocha -- -r thunk-mocha -r intelli-espower-loader -t 200000 test/*.test.js && istanbul report text-summary json lcov",
20-
"test-local": "npm_china=true local=true mocha -r thunk-mocha -r intelli-espower-loader -t 200000 test/*.test.js",
18+
"test": "mocha -r thunk-mocha -t 200000 test/*.test.js",
19+
"test-cov": "istanbul cover --report none --print none node_modules/mocha/bin/_mocha -- -r thunk-mocha -t 200000 test/*.test.js && istanbul report text-summary json lcov",
20+
"test-local": "npm_china=true local=true mocha -r thunk-mocha -t 200000 test/*.test.js",
2121
"lint": "eslint . --fix",
2222
"ci": "npm run lint && npm run test-cov",
2323
"autod": "autod"
@@ -61,7 +61,6 @@
6161
"eslint": "3",
6262
"eslint-config-egg": "3",
6363
"http-proxy": "^1.16.2",
64-
"intelli-espower-loader": "1",
6564
"istanbul": "*",
6665
"mm": "^2.2.1",
6766
"mocha": "3",

test/bigPackage.test.js

+27-24
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,40 @@
22

33
const path = require('path');
44
const rimraf = require('rimraf');
5+
const semver = require('semver');
56
const npminstall = require('./npminstall');
67

7-
describe('test/bigPackage.test.js', () => {
8-
function testcase(name) {
9-
describe(name, () => {
10-
const root = path.join(__dirname, 'fixtures', name);
8+
if (semver.satisfies(process.version, '>= 6.0.0')) {
9+
describe('test/bigPackage.test.js', () => {
10+
function testcase(name) {
11+
describe(name, () => {
12+
const root = path.join(__dirname, 'fixtures', name);
1113

12-
function cleanup() {
13-
rimraf.sync(path.join(root, 'node_modules'));
14-
}
14+
function cleanup() {
15+
rimraf.sync(path.join(root, 'node_modules'));
16+
}
1517

16-
beforeEach(cleanup);
17-
afterEach(cleanup);
18+
beforeEach(cleanup);
19+
afterEach(cleanup);
1820

19-
it('should install success', function* () {
20-
yield npminstall({
21-
root,
22-
trace: true,
21+
it('should install success', function* () {
22+
yield npminstall({
23+
root,
24+
trace: true,
25+
});
2326
});
2427
});
25-
});
26-
}
28+
}
29+
30+
if (process.platform !== 'win32') {
31+
[
32+
'spmtest',
33+
'spmwebpacktest',
34+
].forEach(testcase);
35+
}
2736

28-
if (process.platform !== 'win32') {
2937
[
30-
'spmtest',
31-
'spmwebpacktest',
38+
'standardtest',
3239
].forEach(testcase);
33-
}
34-
35-
[
36-
'standardtest',
37-
].forEach(testcase);
38-
});
40+
});
41+
}

test/installScopeRegistry.test.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ const helper = require('./helper');
88
const npminstall = require('./npminstall');
99

1010
describe('test/installScopeRegistry.test.js', () => {
11-
const [ tmp, cleanup ] = helper.tmp();
11+
const items = helper.tmp();
12+
const tmp = items[0];
13+
const cleanup = items[1];
1214
let mockCnpmrc;
1315

1416
before(() => {

0 commit comments

Comments
 (0)