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 jasnell committed Apr 24, 2017
1 parent 0105e6f commit b968d58
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/parallel/test-process-chdir.js
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 b968d58

Please sign in to comment.