Skip to content

Commit

Permalink
test: run node 16 (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Sep 30, 2021
1 parent 1e9dd19 commit de255f2
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 99 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
node-version: [ 10.x, 12.x, 14.x ]
node-version: [ 10.x, 12.x, 14.x, 16.x ]
platform:
- os: ubuntu-latest
shell: bash
Expand Down
6 changes: 3 additions & 3 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ const pkg = require('../package.json');
const config = {
env: {
// show node-pre-gyp http info
// like "node-pre-gyp http GET https://npm.taobao.org/mirrors/fsevents/v1.0.6/fse-v1.0.6-node-v46-darwin-x64.tar.gz"
// like "node-pre-gyp http GET https://npmmirror.com/mirrors/fsevents/v1.0.6/fse-v1.0.6-node-v46-darwin-x64.tar.gz"
npm_config_loglevel: 'http',
},
chineseMirrorUrl: 'https://npm.taobao.org/mirrors',
chineseRegistry: 'https://registry.npm.taobao.org',
chineseMirrorUrl: 'https://npmmirror.com/mirrors',
chineseRegistry: 'https://registry.npmmirror.com',
userAgent: `npminstall/${pkg.version} npm/? node/${process.version} ${process.platform} ${process.arch}`,
};

Expand Down
3 changes: 1 addition & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,7 @@ exports.getTarballStream = async (url, options) => {

async function getRemotePackage(name, registry, globalOptions) {
const registries = [ registry ].concat([
'https://r.npm.taobao.org',
'https://registry.npm.taobao.org',
'https://registry.npmmirror.com',
'https://r.cnpmjs.org',
'https://registry.npmjs.com',
]);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
"autod": "3",
"coffee": "^5.2.1",
"egg-bin": "^4.13.1",
"eslint": "5",
"eslint": "7",
"eslint-config-egg": "7",
"git-contributor": "^1.0.10",
"http-proxy": "1",
Expand Down
4 changes: 3 additions & 1 deletion test/bigPackage.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';

const semver = require('semver');
const npminstall = require('./npminstall');
const helper = require('./helper');

Expand All @@ -21,7 +22,8 @@ describe('test/bigPackage.test.js', () => {
});
}

if (process.platform !== 'win32') {
// phantomjs break in node >= 16
if (process.platform !== 'win32' && semver.satisfies(process.version, '< 16.0.0')) {
[
'spmtest',
'spmwebpacktest',
Expand Down
2 changes: 2 additions & 0 deletions test/concurrency-install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ describe('test/concurrency-install.test.js', () => {
afterEach(cleanup);

it('should concurrency install success', async () => {
// ignore windows
if (process.platform === 'win32') return;
await Promise.all([
npminstall({
root: root1,
Expand Down
2 changes: 2 additions & 0 deletions test/css-loader.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ describe('test/css-loader.test.js', () => {
// afterEach(cleanup);

it('should work on css-loader', async () => {
// ignore windows
if (process.platform === 'win32') return;
await npminstall({
root: tmp,
registry: 'https://registry.npmjs.com',
Expand Down
2 changes: 1 addition & 1 deletion test/download.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ describe('test/download.test.js', () => {
describe('mock tarball error', () => {
it('should throw sha1 error', async () => {
this.timeout = 15000;
const registry = process.env.npm_registry || 'https://r.npm.taobao.org';
const registry = process.env.npm_registry || 'https://registry.npmmirror.com';
const res = await urllib.request(`${registry}/pedding`, { dataType: 'json', timeout: 10000 });
const pkg = res.data;
pkg.versions['1.0.0'].dist.shasum = '00098d60307b4ef7240c3d693cb20a9473c111';
Expand Down
Loading

0 comments on commit de255f2

Please sign in to comment.