From 2ee64ddde2aba053c7895a2b8905f11c1bb3442d Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Fri, 22 May 2020 14:19:54 +0100 Subject: [PATCH] Ensure unit tests pass with any Node.js ABI version Add Node.js 12 and 14 to CI environment Pin to ABI 64, as supported by 'a-native-module' Remove 'verify-travis-appveyor' dependency as it does not support Node.js 14+ --- .travis.yml | 2 ++ appveyor.yml | 2 ++ package.json | 5 ++--- test/asset-test.js | 1 + test/download-test.js | 5 +++-- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 377b86b..37bce07 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,5 @@ node_js: - 6 - 8 - 10 + - 12 + - 14 \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 88e6042..182a3e7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -13,6 +13,8 @@ version: "{build}" environment: # Test against these versions of Node.js matrix: + - nodejs_version: "14" + - nodejs_version: "12" - nodejs_version: "10" - nodejs_version: "8" - nodejs_version: "6" diff --git a/package.json b/package.json index c7aafe9..74f39f1 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "5.3.4", "description": "A command line tool to easily install prebuilt binaries for multiple version of node/iojs on a specific platform", "scripts": { - "test": "verify-travis-appveyor && tape test/*-test.js && npm run lint", + "test": "tape test/*-test.js && npm run lint", "lint": "standard" }, "keywords": [ @@ -40,8 +40,7 @@ "nock": "^10.0.6", "rimraf": "^2.5.2", "standard": "^13.0.2", - "tape": "^4.5.1", - "verify-travis-appveyor": "^3.0.1" + "tape": "^4.5.1" }, "bin": "./bin.js", "repository": { diff --git a/test/asset-test.js b/test/asset-test.js index f65f867..37d1147 100644 --- a/test/asset-test.js +++ b/test/asset-test.js @@ -125,6 +125,7 @@ function getOpts () { return { pkg: require('a-native-module/package'), runtime: 'node', + abi: 64, platform: process.platform, arch: process.arch, path: __dirname, diff --git a/test/download-test.js b/test/download-test.js index 9a31b96..3ee4fac 100644 --- a/test/download-test.js +++ b/test/download-test.js @@ -129,7 +129,7 @@ test('existing host but invalid url should fail', function (t) { var cachedPrebuild = util.cachedPrebuild(downloadUrl) var server = http.createServer(function (req, res) { - t.equal(req.url, '/prebuilds/woohooo-' + process.versions.modules, 'correct url') + t.equal(req.url, '/prebuilds/woohooo-' + opts.abi, 'correct url') res.statusCode = 404 res.end() }).listen(8888, function () { @@ -180,7 +180,7 @@ test('error during download should fail with no dangling temp file', function (t } var server = http.createServer(function (req, res) { - t.equal(req.url, '/prebuilds/woohooo-' + process.versions.modules, 'correct url') + t.equal(req.url, '/prebuilds/woohooo-' + opts.abi, 'correct url') res.statusCode = 200 res.write('yep') // simulates hanging request }).listen(8889, function () { @@ -221,6 +221,7 @@ function getOpts () { return { pkg: require('a-native-module/package'), runtime: 'node', + abi: 64, platform: process.platform, arch: process.arch, path: __dirname,