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 <[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]>
  • Loading branch information
vperezma authored and MylesBorins committed May 18, 2017
1 parent 51794dd commit 32f905a
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 32f905a

Please sign in to comment.