diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-05-18 11:28:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-18 11:28:35 +0800 |
commit | efcf167e5efc95a82678db2056396dcf94993641 (patch) | |
tree | 45bec5ba66ee834d539057dce26069f251fec858 /test/sandbox.js | |
parent | 6ed90913cae80e55b9575a64a59ef7b1bd06e702 (diff) | |
download | tracifyjs-efcf167e5efc95a82678db2056396dcf94993641.tar.gz tracifyjs-efcf167e5efc95a82678db2056396dcf94993641.zip |
make `expect_stdout` node version specific (#1963)
... via semver string on `node_version` label.
Diffstat (limited to 'test/sandbox.js')
-rw-r--r-- | test/sandbox.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/sandbox.js b/test/sandbox.js index c155f91c..974f5211 100644 --- a/test/sandbox.js +++ b/test/sandbox.js @@ -1,3 +1,4 @@ +var semver = require("semver"); var vm = require("vm"); function safe_log(arg, level) { @@ -63,7 +64,7 @@ exports.run_code = function(code) { process.stdout.write = original_write; } }; -exports.same_stdout = ~process.version.lastIndexOf("v0.12.", 0) ? function(expected, actual) { +exports.same_stdout = semver.satisfies(process.version, "0.12") ? function(expected, actual) { if (typeof expected != typeof actual) return false; if (typeof expected != "string") { if (expected.name != actual.name) return false; |