From 2c1472c1b988fa7f50e646f22ca5dad4a7211c34 Mon Sep 17 00:00:00 2001 From: vperezma Date: Sat, 22 Apr 2017 11:15:18 -0700 Subject: [PATCH] test: improve test-process-chdir remove typeError constructor and replace with regex string to match typeError message PR-URL: https://github.com/nodejs/node/pull/12589 Reviewed-By: Anna Henningsen Reviewed-By: Rich Trott Reviewed-By: Colin Ihrig Reviewed-By: David Cai Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock --- test/parallel/test-process-chdir.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-process-chdir.js b/test/parallel/test-process-chdir.js index abf06b3c523cb4..f54026467eb6cd 100644 --- a/test/parallel/test-process-chdir.js +++ b/test/parallel/test-process-chdir.js @@ -30,7 +30,9 @@ process.chdir('..'); assert.strictEqual(process.cwd().normalize(), path.resolve(common.tmpDir).normalize()); -assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.'); -assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.'); +assert.throws(function() { process.chdir({}); }, + /^TypeError: Bad argument\.$/, 'Bad argument.'); +assert.throws(function() { process.chdir(); }, + /^TypeError: Bad argument\.$/, 'Bad argument.'); assert.throws(function() { process.chdir('x', 'y'); }, - TypeError, 'Bad argument.'); + /^TypeError: Bad argument\.$/, 'Bad argument.');