Skip to content

Commit

Permalink
test: make test-uv-binding-constant JS engine neutral
Browse files Browse the repository at this point in the history
The error message validation in test-uv-binding-constant depends on the
JS engine. The text will be different in node-chakracore than in
V8-based versions of Node.js. Remove the message validation. Test that
it is a TypeError only. We should only validate error messages when we
control the contents of that error message (and not even necessarily
then, but that is a minimum requirement). V8 and other underlying
engines can change the error message at any time and that should not
require us to change our tests (as changing tests suggests a
semver-major change).

PR-URL: #24666
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Anto Aravinth <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and targos committed Nov 28, 2018
1 parent 3288c27 commit 84249df
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test/parallel/test-uv-binding-constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ const keys = Object.keys(uv);
keys.forEach((key) => {
if (key.startsWith('UV_')) {
const val = uv[key];
assert.throws(() => uv[key] = 1,
/^TypeError: Cannot assign to read only property/);
assert.throws(() => uv[key] = 1, TypeError);
assert.strictEqual(uv[key], val);
}
});

0 comments on commit 84249df

Please sign in to comment.