@@ -221,10 +221,7 @@ function assertExpectations({assertion, actual, expectations, message, prefix, s
221221}
222222
223223function wrapAssertions ( callbacks ) {
224- const pass = callbacks . pass ;
225- const pending = callbacks . pending ;
226- const fail = callbacks . fail ;
227-
224+ const { pass, pending, fail} = callbacks ;
228225 const noop = ( ) => { } ;
229226
230227 const assertions = {
@@ -336,6 +333,7 @@ function wrapAssertions(callbacks) {
336333 try {
337334 retval . catch ( noop ) ;
338335 } catch ( _ ) { }
336+
339337 fail ( this , new AssertionError ( {
340338 assertion : 'throws' ,
341339 message,
@@ -539,6 +537,7 @@ function wrapAssertions(callbacks) {
539537 } else if ( optionsOrMessage ) {
540538 options . id = optionsOrMessage . id ;
541539 }
540+
542541 options . expected = expected ;
543542 options . message = message ;
544543
@@ -633,6 +632,7 @@ function wrapAssertions(callbacks) {
633632 values : [ formatWithLabel ( 'Called with:' , string ) ]
634633 } ) ;
635634 }
635+
636636 if ( ! ( regex instanceof RegExp ) ) {
637637 throw new AssertionError ( {
638638 assertion : 'regex' ,
@@ -663,6 +663,7 @@ function wrapAssertions(callbacks) {
663663 values : [ formatWithLabel ( 'Called with:' , string ) ]
664664 } ) ;
665665 }
666+
666667 if ( ! ( regex instanceof RegExp ) ) {
667668 throw new AssertionError ( {
668669 assertion : 'notRegex' ,
@@ -687,4 +688,5 @@ function wrapAssertions(callbacks) {
687688
688689 return Object . assign ( assertions , enhancedAssertions ) ;
689690}
691+
690692exports . wrapAssertions = wrapAssertions ;
0 commit comments