Skip to content

Commit

Permalink
Disable invalid json chars test in node 10
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed May 8, 2018
1 parent e39d609 commit 3703154
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -81,6 +81,7 @@
"has-template-literals": "^1.0.0",
"isstream": "^0.1.2",
"make-generator-function": "^1.1.0",
"semver": "^5.5.0",
"seq": "0.3.5",
"tap": "^10.7.2",
"temp": "^0.8.1",
Expand Down
3 changes: 2 additions & 1 deletion test/error_code.js
@@ -1,9 +1,10 @@
var test = require('tap').test;
var spawn = require('child_process').spawn;
var path = require('path');
var semver = require('semver');

// TODO this should be fixable I guess
var knownFailure = process.platform === 'win32' && /^v0\.10\.\d+$/.test(process.version);
var knownFailure = process.platform === 'win32' && semver.satisfies(process.version, 'v0.10.x');

test('error code', { skip: knownFailure }, function (t) {
t.plan(2);
Expand Down
6 changes: 5 additions & 1 deletion test/json.js
@@ -1,6 +1,7 @@
var browserify = require('../');
var fs = require('fs');
var vm = require('vm');
var semver = require('semver');
var test = require('tap').test;

test('json', function (t) {
Expand All @@ -18,7 +19,10 @@ test('json', function (t) {
});
});

test('verify evil json', function(t) {
// This works in Node v10 and up thanks to the JSON superset proposal, which
// allows the evil chars in javascript strings.
// https://github.com/tc39/proposal-json-superset
test('verify evil json', { skip: semver.gte(process.version, 'v10.0.0') }, function(t) {
t.plan(1);
fs.readFile(__dirname + '/json/evil-chars.json', function(err, data) {
if (err) t.fail(err);
Expand Down

0 comments on commit 3703154

Please sign in to comment.