diff --git a/test/parallel/test-os-eol.js b/test/parallel/test-os-eol.js index 7a7a300717cfe8..412751a151b9a2 100644 --- a/test/parallel/test-os-eol.js +++ b/test/parallel/test-os-eol.js @@ -8,12 +8,9 @@ const eol = common.isWindows ? '\r\n' : '\n'; assert.strictEqual(os.EOL, eol); -common.expectsError(function() { - os.EOL = 123; -}, { - type: TypeError, - message: /^Cannot assign to read only property 'EOL' of object '#'$/ -}); +// Test that the `Error` is a `TypeError` but do not check the message as it +// varies between different JavaScript engines. +assert.throws(function() { os.EOL = 123; }, TypeError); const foo = 'foo'; Object.defineProperties(os, {