diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-05-15 18:44:19 +0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-05-18 16:09:00 +0200 |
commit | 2c42999f7e0cfb4d79124add35e0b19b50100074 (patch) | |
tree | 5fe135c41a6cca16d919f287be1faf74879a1763 /test | |
parent | 3424f71cc900ce2bb22615630c37ba236a2060a4 (diff) | |
download | android-node-v8-2c42999f7e0cfb4d79124add35e0b19b50100074.tar.gz android-node-v8-2c42999f7e0cfb4d79124add35e0b19b50100074.tar.bz2 android-node-v8-2c42999f7e0cfb4d79124add35e0b19b50100074.zip |
assert: fix EOL issue in messages on Windows
PR-URL: https://github.com/nodejs/node/pull/20754
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-assert.js | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 51c9e677b1..b731b9a73e 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -27,7 +27,6 @@ const common = require('../common'); const assert = require('assert'); -const { EOL } = require('os'); const EventEmitter = require('events'); const { errorCache } = require('internal/assert'); const { writeFileSync, unlinkSync } = require('fs'); @@ -462,8 +461,8 @@ assert.throws( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert.ok(typeof 123 === 'string')${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + "assert.ok(typeof 123 === 'string')\n" } ); Error.stackTraceLimit = tmpLimit; @@ -625,8 +624,8 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, generatedMessage: true, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert.ok(null)${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + 'assert.ok(null)\n' } ); common.expectsError( @@ -635,8 +634,8 @@ common.expectsError( code: 'ERR_ASSERTION', type: assert.AssertionError, generatedMessage: true, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(typeof 123 === 'string')${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + "assert(typeof 123 === 'string')\n" } ); @@ -666,8 +665,8 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(Buffer.from('test') instanceof Error)${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + "assert(Buffer.from('test') instanceof Error)\n" } ); common.expectsError( @@ -675,8 +674,8 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(Buffer.from('test') instanceof Error)${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + "assert(Buffer.from('test') instanceof Error)\n" } ); fs.close = tmp; @@ -695,12 +694,12 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert((() => 'string')()${EOL}` + - ` // eslint-disable-next-line${EOL}` + - ` ===${EOL}` + - ` 123 instanceof${EOL}` + - ` Buffer)${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + "assert((() => 'string')()\n" + + ' // eslint-disable-next-line\n' + + ' ===\n' + + ' 123 instanceof\n' + + ' Buffer)\n' } ); @@ -709,8 +708,8 @@ common.expectsError( { code: 'ERR_ASSERTION', type: assert.AssertionError, - message: `The expression evaluated to a falsy value:${EOL}${EOL} ` + - `assert(null, undefined)${EOL}` + message: 'The expression evaluated to a falsy value:\n\n ' + + 'assert(null, undefined)\n' } ); |