From 1eb581779db54311d969b7a0ebb7659ad5f2fc3f Mon Sep 17 00:00:00 2001 From: Jay Brownlee Date: Thu, 1 Dec 2016 10:06:21 -0600 Subject: [PATCH] test: refactor test-vm-syntax-error-stderr.js use common.fail instead of assert(false) change var to let or const as appropriate PR-URL: https://github.com/nodejs/node/pull/9900 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-vm-syntax-error-stderr.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/test/parallel/test-vm-syntax-error-stderr.js b/test/parallel/test-vm-syntax-error-stderr.js index 7c3c5ff1351da2..43ed8d882804ca 100644 --- a/test/parallel/test-vm-syntax-error-stderr.js +++ b/test/parallel/test-vm-syntax-error-stderr.js @@ -1,22 +1,22 @@ 'use strict'; -var common = require('../common'); -var assert = require('assert'); -var path = require('path'); -var child_process = require('child_process'); +const common = require('../common'); +const assert = require('assert'); +const path = require('path'); +const child_process = require('child_process'); -var wrong_script = path.join(common.fixturesDir, 'cert.pem'); +const wrong_script = path.join(common.fixturesDir, 'cert.pem'); -var p = child_process.spawn(process.execPath, [ +const p = child_process.spawn(process.execPath, [ '-e', 'require(process.argv[1]);', wrong_script ]); p.stdout.on('data', function(data) { - assert(false, 'Unexpected stdout data: ' + data); + common.fail('Unexpected stdout data: ' + data); }); -var output = ''; +let output = ''; p.stderr.on('data', function(data) { output += data;