2727
2828const common = require ( '../common' ) ;
2929const assert = require ( 'assert' ) ;
30- const { EOL } = require ( 'os' ) ;
3130const EventEmitter = require ( 'events' ) ;
3231const { errorCache } = require ( 'internal/assert' ) ;
3332const { writeFileSync, unlinkSync } = require ( 'fs' ) ;
@@ -462,8 +461,8 @@ assert.throws(
462461 {
463462 code : 'ERR_ASSERTION' ,
464463 type : assert . AssertionError ,
465- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
466- ` assert.ok(typeof 123 === 'string')${ EOL } `
464+ message : ' The expression evaluated to a falsy value:\n\n ' +
465+ " assert.ok(typeof 123 === 'string')\n"
467466 }
468467 ) ;
469468 Error . stackTraceLimit = tmpLimit ;
@@ -625,8 +624,8 @@ common.expectsError(
625624 code : 'ERR_ASSERTION' ,
626625 type : assert . AssertionError ,
627626 generatedMessage : true ,
628- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
629- ` assert.ok(null)${ EOL } `
627+ message : ' The expression evaluated to a falsy value:\n\n ' +
628+ ' assert.ok(null)\n'
630629 }
631630) ;
632631common . expectsError (
@@ -635,8 +634,8 @@ common.expectsError(
635634 code : 'ERR_ASSERTION' ,
636635 type : assert . AssertionError ,
637636 generatedMessage : true ,
638- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
639- ` assert(typeof 123 === 'string')${ EOL } `
637+ message : ' The expression evaluated to a falsy value:\n\n ' +
638+ " assert(typeof 123 === 'string')\n"
640639 }
641640) ;
642641
@@ -666,17 +665,17 @@ common.expectsError(
666665 {
667666 code : 'ERR_ASSERTION' ,
668667 type : assert . AssertionError ,
669- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
670- ` assert(Buffer.from('test') instanceof Error)${ EOL } `
668+ message : ' The expression evaluated to a falsy value:\n\n ' +
669+ " assert(Buffer.from('test') instanceof Error)\n"
671670 }
672671 ) ;
673672 common . expectsError (
674673 ( ) => throwErr ( ) ,
675674 {
676675 code : 'ERR_ASSERTION' ,
677676 type : assert . AssertionError ,
678- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
679- ` assert(Buffer.from('test') instanceof Error)${ EOL } `
677+ message : ' The expression evaluated to a falsy value:\n\n ' +
678+ " assert(Buffer.from('test') instanceof Error)\n"
680679 }
681680 ) ;
682681 fs . close = tmp ;
@@ -695,12 +694,12 @@ common.expectsError(
695694 {
696695 code : 'ERR_ASSERTION' ,
697696 type : assert . AssertionError ,
698- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
699- ` assert((() => 'string')()${ EOL } ` +
700- ` // eslint-disable-next-line${ EOL } ` +
701- ` ===${ EOL } ` +
702- ` 123 instanceof${ EOL } ` +
703- ` Buffer)${ EOL } `
697+ message : ' The expression evaluated to a falsy value:\n\n ' +
698+ " assert((() => 'string')()\n" +
699+ ' // eslint-disable-next-line\n' +
700+ ' ===\n' +
701+ ' 123 instanceof\n' +
702+ ' Buffer)\n'
704703 }
705704) ;
706705
@@ -709,8 +708,8 @@ common.expectsError(
709708 {
710709 code : 'ERR_ASSERTION' ,
711710 type : assert . AssertionError ,
712- message : ` The expression evaluated to a falsy value:${ EOL } ${ EOL } ` +
713- ` assert(null, undefined)${ EOL } `
711+ message : ' The expression evaluated to a falsy value:\n\n ' +
712+ ' assert(null, undefined)\n'
714713 }
715714) ;
716715
0 commit comments