Skip to content

Commit

Permalink
test: make test-os-eol engine agnostic
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • Loading branch information
Trott authored and evanlucas committed Nov 13, 2017
1 parent 79e1831 commit 9bf8874
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/parallel/test-os-eol.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '#<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, {
Expand Down

0 comments on commit 9bf8874

Please sign in to comment.