Skip to content

Commit 32f905a

Browse files
vperezmaMylesBorins
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 <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Cai <davidcai1993@yahoo.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 51794dd commit 32f905a

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)