Skip to content

Commit 9bf8874

Browse files
Trottevanlucas
authored andcommitted
test: make test-os-eol engine agnostic
Do not check the error message if it is generated by the JavaScript engine (V8, ChakraCore, etc.). Do confirm that it is a `TypeError`. PR-URL: #16272 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
1 parent 79e1831 commit 9bf8874

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/parallel/test-os-eol.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ const eol = common.isWindows ? '\r\n' : '\n';
88

99
assert.strictEqual(os.EOL, eol);
1010

11-
common.expectsError(function() {
12-
os.EOL = 123;
13-
}, {
14-
type: TypeError,
15-
message: /^Cannot assign to read only property 'EOL' of object '#<Object>'$/
16-
});
11+
// Test that the `Error` is a `TypeError` but do not check the message as it
12+
// varies between different JavaScript engines.
13+
assert.throws(function() { os.EOL = 123; }, TypeError);
1714

1815
const foo = 'foo';
1916
Object.defineProperties(os, {

0 commit comments

Comments
 (0)