Skip to content

Commit

Permalink
test: improve test-process-chdir
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
vperezma authored and evanlucas committed May 2, 2017
1 parent 14e93f6 commit 1a4bf43
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-process-chdir.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.');

0 comments on commit 1a4bf43

Please sign in to comment.