Test node 10 and 12 on CI (#2548)

This commit is contained in:
Adam Stankiewicz
2019-12-10 08:53:36 +01:00
committed by GitHub
parent 997fb2b298
commit fd2d448b7e
10 changed files with 650 additions and 1693 deletions

View File

@@ -13,7 +13,8 @@ env:
- TEST_NODE_VERSION="4"
- TEST_NODE_VERSION="6"
- TEST_NODE_VERSION="8"
- TEST_NODE_VERSION="9"
- TEST_NODE_VERSION="10"
- TEST_NODE_VERSION="12"
before_install:
- node --version

View File

@@ -79,11 +79,12 @@
"husky": "^0.14.3",
"in-publish": "^2.0.0",
"istanbul": "^0.4.3",
"lint-staged": "^7.0.0",
"lint-staged": "^9.5.0",
"load-grunt-tasks": "^3.5.0",
"mocha": "^2.5.3",
"multiline": "^1.0.2",
"nock": "^9.2.3",
"nock-legacy": "npm:nock@9.2.3",
"nock": "^11.7.0",
"node-uuid": "^1.4.7",
"prettier": "^1.11.1",
"proxyquire": "^1.7.9",
@@ -100,8 +101,7 @@
},
"lint-staged": {
"*.js": [
"prettier --single-quote --tab-width 4",
"git add"
"prettier --single-quote --tab-width 4"
]
},
"files": [

View File

@@ -1,7 +1,7 @@
var expect = require('expect.js');
var path = require('path');
var helpers = require('../helpers');
var nock = require('nock');
var nock = require('../util/nock');
var rimraf = require('rimraf');
var fs = require('../../lib/util/fs');
var tar = require('tar-fs');
@@ -708,8 +708,8 @@ describe('bower install', function() {
cwd: tempDir.path
});
nock('http://dummy.local')
.get('http://github.com/yahoo/pure/archive/v0.6.0.tar.gz')
nock('http://dummy.local/')
.get(function(uri) { return true; })
.reply(500);
return helpers

View File

@@ -146,7 +146,7 @@ describe('GitFsResolver', function() {
var dir = path.join(testPackage, 'new-dir');
fs.writeFileSync(file, 'foo');
fs.mkdir(dir);
fs.mkdirSync(dir);
function cleanup(err) {
fs.unlinkSync(file);

View File

@@ -1,5 +1,5 @@
var path = require('path');
var nock = require('nock');
var nock = require('../../util/nock');
var fs = require('../../../lib/util/fs');
var expect = require('expect.js');
var Logger = require('bower-logger');

View File

@@ -1,7 +1,7 @@
var expect = require('expect.js');
var path = require('path');
var fs = require('../../../lib/util/fs');
var nock = require('nock');
var nock = require('../../util/nock');
var Q = require('q');
var rimraf = require('../../../lib/util/rimraf');
var mkdirp = require('mkdirp');

View File

@@ -15,7 +15,7 @@ var proxyquire = require('proxyquire')
.noPreserveCache();
var spawnSync = require('spawn-sync');
var config = require('../lib/config');
var nock = require('nock');
var nock = require('./util/nock');
var semver = require('semver');
// For better promise errors

View File

@@ -1,6 +1,6 @@
var expect = require('expect.js');
var helpers = require('../helpers');
var nock = require('nock');
var nock = require('../util/nock');
var path = require('path');
var Q = require('q');
@@ -13,13 +13,11 @@ describe('download', function() {
destination = tempDir.getPath('package.tar.gz');
function downloadTest(opts) {
var deferred = Q.defer();
tempDir.prepare();
opts.response(nock('http://bower.io', opts.nockOpts));
download(
return download(
opts.sourceUrl || 'http://bower.io/package.tar.gz',
opts.destinationPath || destination,
opts.downloadOpts
@@ -28,27 +26,20 @@ describe('download', function() {
function(result) {
if (opts.expect) {
opts.expect(result);
deferred.resolve();
} else {
deferred.reject(
new Error(
'Error expected. Got successful response.'
)
throw new Error(
'Error expected. Got successful response.'
);
}
},
function(error) {
if (opts.expectError) {
opts.expectError(error);
deferred.resolve();
} else {
deferred.reject(error);
throw error
}
}
)
.done();
return deferred.promise;
}
it('download file to directory', function() {

3
test/util/nock.js Normal file
View File

@@ -0,0 +1,3 @@
var NODE_MAJOR_VERSION = process.versions.node.split('.')[0];
module.exports = NODE_MAJOR_VERSION >= 12 ? require('nock') : require('nock-legacy')

2296
yarn.lock

File diff suppressed because it is too large Load Diff