Skip to content

Commit

Permalink
test: Fix checking Node version
Browse files Browse the repository at this point in the history
  • Loading branch information
nwoltman committed Apr 25, 2018
1 parent 43d3a6e commit bebce67
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/testUtils.js
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bebce67

Please sign in to comment.