27
27
28
28
const common = require ( '../common' ) ;
29
29
const assert = require ( 'assert' ) ;
30
- const { EOL } = require ( 'os' ) ;
31
30
const EventEmitter = require ( 'events' ) ;
32
31
const { errorCache } = require ( 'internal/assert' ) ;
33
32
const { writeFileSync, unlinkSync } = require ( 'fs' ) ;
@@ -462,8 +461,8 @@ assert.throws(
462
461
{
463
462
code : 'ERR_ASSERTION' ,
464
463
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"
467
466
}
468
467
) ;
469
468
Error . stackTraceLimit = tmpLimit ;
@@ -625,8 +624,8 @@ common.expectsError(
625
624
code : 'ERR_ASSERTION' ,
626
625
type : assert . AssertionError ,
627
626
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'
630
629
}
631
630
) ;
632
631
common . expectsError (
@@ -635,8 +634,8 @@ common.expectsError(
635
634
code : 'ERR_ASSERTION' ,
636
635
type : assert . AssertionError ,
637
636
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"
640
639
}
641
640
) ;
642
641
@@ -666,17 +665,17 @@ common.expectsError(
666
665
{
667
666
code : 'ERR_ASSERTION' ,
668
667
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"
671
670
}
672
671
) ;
673
672
common . expectsError (
674
673
( ) => throwErr ( ) ,
675
674
{
676
675
code : 'ERR_ASSERTION' ,
677
676
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"
680
679
}
681
680
) ;
682
681
fs . close = tmp ;
@@ -695,12 +694,12 @@ common.expectsError(
695
694
{
696
695
code : 'ERR_ASSERTION' ,
697
696
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'
704
703
}
705
704
) ;
706
705
@@ -709,8 +708,8 @@ common.expectsError(
709
708
{
710
709
code : 'ERR_ASSERTION' ,
711
710
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'
714
713
}
715
714
) ;
716
715
0 commit comments