From bebce679722f3d1ee27b6149e0609fe169b03b53 Mon Sep 17 00:00:00 2001 From: Nathan Woltman Date: Tue, 24 Apr 2018 23:07:31 -0400 Subject: [PATCH] test: Fix checking Node version --- test/testUtils.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/testUtils.js b/test/testUtils.js index a753369..289c651 100644 --- a/test/testUtils.js +++ b/test/testUtils.js @@ -1,11 +1,11 @@ 'use strict' -const nodeVersionMajor = +process.version.match(/^v(\d+)/)[1] -const nodeVersionMinor = +process.version.match(/^v\d+\.(\d+)/)[1] +const major = +process.version.match(/^v(\d+)/)[1] +const minor = +process.version.match(/^v\d+\.(\d+)/)[1] const testUtils = { - supportsAsyncAwait: nodeVersionMajor >= 7 && nodeVersionMinor >= 6, - supportsHTTP2: nodeVersionMajor >= 8 && nodeVersionMinor >= 8, + supportsAsyncAwait: major > 7 || major === 7 && minor >= 6, + supportsHTTP2: major > 8 || major === 8 && minor >= 8, } module.exports = testUtils