@@ -2,7 +2,7 @@ import concordance from 'concordance';
2
2
import isPromise from 'is-promise' ;
3
3
import plur from 'plur' ;
4
4
5
- import { AssertionError , Assertions , checkAssertionMessage } from './assert.js' ;
5
+ import { AssertionError , Assertions , checkAssertionMessage , hasOwnProperty } from './assert.js' ;
6
6
import concordanceOptions from './concordance-options.js' ;
7
7
import nowAndTimers from './now-and-timers.cjs' ;
8
8
import parseTestArgs from './parse-test-args.js' ;
@@ -14,7 +14,7 @@ function isExternalAssertError(error) {
14
14
}
15
15
16
16
// Match errors thrown by <https://www.npmjs.com/package/chai> and <https://nodejs.org/api/assert.html>.
17
- return error . hasOwnProperty ( 'actual' ) && error . hasOwnProperty ( 'expected' ) ;
17
+ return hasOwnProperty ( error , 'actual' ) && hasOwnProperty ( error , 'expected' ) ;
18
18
}
19
19
20
20
function formatErrorValue ( label , error ) {
@@ -533,13 +533,13 @@ export default class Test {
533
533
this . saveFirstError ( new AssertionError ( {
534
534
message : 'Assertion failed' ,
535
535
savedError : result . error instanceof Error && result . error ,
536
- values : [ { label : 'Assertion failed: ' , formatted : result . error . message } ]
536
+ values : [ { label : 'Assertion failed: ' , formatted : result . error . message } ] ,
537
537
} ) ) ;
538
538
} else {
539
539
this . saveFirstError ( new AssertionError ( {
540
540
message : 'Error thrown in test' ,
541
541
savedError : result . error instanceof Error && result . error ,
542
- values : [ formatErrorValue ( 'Error thrown in test:' , result . error ) ]
542
+ values : [ formatErrorValue ( 'Error thrown in test:' , result . error ) ] ,
543
543
} ) ) ;
544
544
}
545
545
@@ -586,13 +586,13 @@ export default class Test {
586
586
this . saveFirstError ( new AssertionError ( {
587
587
message : 'Assertion failed' ,
588
588
savedError : error instanceof Error && error ,
589
- values : [ { label : 'Assertion failed: ' , formatted : error . message } ]
589
+ values : [ { label : 'Assertion failed: ' , formatted : error . message } ] ,
590
590
} ) ) ;
591
591
} else {
592
592
this . saveFirstError ( new AssertionError ( {
593
593
message : 'Rejected promise returned by test' ,
594
594
savedError : error instanceof Error && error ,
595
- values : [ formatErrorValue ( 'Rejected promise returned by test. Reason:' , error ) ]
595
+ values : [ formatErrorValue ( 'Rejected promise returned by test. Reason:' , error ) ] ,
596
596
} ) ) ;
597
597
}
598
598
} )
0 commit comments