mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
parent
bb91599d03
commit
97439e61f8
@ -8,12 +8,9 @@ const eol = common.isWindows ? '\r\n' : '\n';
|
|||||||
|
|
||||||
assert.strictEqual(os.EOL, eol);
|
assert.strictEqual(os.EOL, eol);
|
||||||
|
|
||||||
common.expectsError(function() {
|
// Test that the `Error` is a `TypeError` but do not check the message as it
|
||||||
os.EOL = 123;
|
// varies between different JavaScript engines.
|
||||||
}, {
|
assert.throws(function() { os.EOL = 123; }, TypeError);
|
||||||
type: TypeError,
|
|
||||||
message: /^Cannot assign to read only property 'EOL' of object '#<Object>'$/
|
|
||||||
});
|
|
||||||
|
|
||||||
const foo = 'foo';
|
const foo = 'foo';
|
||||||
Object.defineProperties(os, {
|
Object.defineProperties(os, {
|
||||||
|
Loading…
Reference in New Issue
Block a user