From eb0e1532aecd700fa4cec7b001646dffb71557b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 9 Oct 2020 13:39:46 +0200 Subject: [PATCH] skip crypto tests in old node.js --- test/crypto.js | 4 +++- test/crypto_ig.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/crypto.js b/test/crypto.js index 7edb25594..453ddb368 100644 --- a/test/crypto.js +++ b/test/crypto.js @@ -4,6 +4,7 @@ var path = require('path'); var fs = require('fs'); var vm = require('vm'); var concat = require('concat-stream'); +var semver = require('semver'); var temp = require('temp'); temp.track(); @@ -13,7 +14,8 @@ fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; -test('*-browserify libs from node_modules/', function (t) { +// `crypto-browserify` no longer works in node.js <4 +test('*-browserify libs from node_modules/', { skip: semver.lt(process.version, 'v4.0.0') }, function (t) { t.plan(2); var bin = __dirname + '/../bin/cmd.js'; diff --git a/test/crypto_ig.js b/test/crypto_ig.js index c60b5bf60..932ee9ef8 100644 --- a/test/crypto_ig.js +++ b/test/crypto_ig.js @@ -4,6 +4,7 @@ var path = require('path'); var fs = require('fs'); var vm = require('vm'); var concat = require('concat-stream'); +var semver = require('semver'); var temp = require('temp'); temp.track(); @@ -13,7 +14,8 @@ fs.writeFileSync(tmpdir + '/main.js', 'beep(require("crypto"))\n'); if (!ArrayBuffer.isView) ArrayBuffer.isView = function () { return false; }; -test('crypto --insertGlobals', function (t) { +// `crypto-browserify` no longer works in node.js <4 +test('crypto --insertGlobals', { skip: semver.lt(process.version, 'v4.0.0') }, function (t) { t.plan(2); var bin = __dirname + '/../bin/cmd.js';