From 84249dfac69061128c7c2de0c7e99beafcc7d8dc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 26 Nov 2018 19:38:02 -0800 Subject: [PATCH] test: make test-uv-binding-constant JS engine neutral 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: https://github.com/nodejs/node/pull/24666 Reviewed-By: Richard Lau Reviewed-By: Minwoo Jung Reviewed-By: Anto Aravinth Reviewed-By: Franziska Hinkelmann Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca --- test/parallel/test-uv-binding-constant.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/parallel/test-uv-binding-constant.js b/test/parallel/test-uv-binding-constant.js index 11d9f6aa09cfd1..12f19188281262 100644 --- a/test/parallel/test-uv-binding-constant.js +++ b/test/parallel/test-uv-binding-constant.js @@ -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); } });