Skip to content

Commit 1a4bf43

Browse files
vperezmaevanlucas
authored andcommitted
test: improve test-process-chdir
remove typeError constructor and replace with regex string to match typeError message PR-URL: #12589 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Cai <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 14e93f6 commit 1a4bf43

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/parallel/test-process-chdir.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ process.chdir('..');
3030
assert.strictEqual(process.cwd().normalize(),
3131
path.resolve(common.tmpDir).normalize());
3232

33-
assert.throws(function() { process.chdir({}); }, TypeError, 'Bad argument.');
34-
assert.throws(function() { process.chdir(); }, TypeError, 'Bad argument.');
33+
assert.throws(function() { process.chdir({}); },
34+
/^TypeError: Bad argument\.$/, 'Bad argument.');
35+
assert.throws(function() { process.chdir(); },
36+
/^TypeError: Bad argument\.$/, 'Bad argument.');
3537
assert.throws(function() { process.chdir('x', 'y'); },
36-
TypeError, 'Bad argument.');
38+
/^TypeError: Bad argument\.$/, 'Bad argument.');

0 commit comments

Comments
 (0)