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.');