Skip to content

Commit c0adaf2

Browse files
committed
use process.version to skip ES6 tests
[0.12 docs](https://nodejs.org/docs/latest-v0.12.x/api/process.html#process_process_version) say > # Process > The process object is a global object and can be accessed from anywhere. > > ## process.version > A compiled-in property that exposes NODE_VERSION. [Current docs](https://nodejs.org/api/process.html#process_process_version) say > # Process > The process object is a global that provides information about, and > control over, the current Node.js process. As a global, it is always > available to Node.js applications without using require(). > > ## process.version > Added in: v0.1.3 > * `<string>` > The process.version property returns the Node.js version string.
1 parent a067d50 commit c0adaf2

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

test/unit/test-Lexer.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
var process = require('process');
2-
31
// If we're on a Node runtime that should support ES6, run the ES6 tests.
4-
var nodeVersion = process.env.npm_config_node_version;
5-
if (/^[0-5][.]/.test(nodeVersion || '')) {
2+
if (/^v?[0-5][.]/.test(process.version)) {
63
// The major version is a single digit in [0, 5].
74
console.info('Skipping ES6 tests for node_version %s', nodeVersion);
85
} else {

test/unit/test-Template.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
var assert = require('assert');
22
var SqlString = require('../../');
3-
var process = require('process');
43
var test = require('utest');
54

65
// If we're on a Node runtime that should support ES6, run the ES6 tests.
7-
var nodeVersion = process.env.npm_config_node_version;
8-
if (/^[0-5][.]/.test(nodeVersion || '')) {
6+
if (/^v?[0-5][.]/.test(process.version)) {
97
// The major version is a single digit in [0, 5].
108
console.info('Skipping ES6 tests for node_version %s', nodeVersion);
119
} else {

0 commit comments

Comments
 (0)