Browse Source

test: improve test-process-chdir

remove typeError constructor and replace with regex string
to match typeError message

PR-URL: https://github.com/nodejs/node/pull/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>
v6.x
vperezma 8 years ago
committed by Myles Borins
parent
commit
32f905a85d
No known key found for this signature in database GPG Key ID: 933B01F40B5CA946
  1. 8
      test/parallel/test-process-chdir.js

8
test/parallel/test-process-chdir.js

@ -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.');

Loading…
Cancel
Save