From 1b96d812cc4770cee5825dcb6bacd31ebd23dc6c 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 beae7672db12f5..8bd4fa0b3294e9 100644 --- a/test/parallel/test-uv-binding-constant.js +++ b/test/parallel/test-uv-binding-constant.js @@ -11,8 +11,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); } });