@@ -56,7 +56,7 @@ function assertFailure(t, subset) {
5656 if ( subset . values ) {
5757 t . equal ( lastFailure . values . length , subset . values . length ) ;
5858 for ( const [ i , s ] of lastFailure . values . entries ( ) ) {
59- t . equal ( s . label , subset . values [ i ] . label ) ;
59+ t . equal ( stripAnsi ( s . label ) , subset . values [ i ] . label ) ;
6060 t . match ( stripAnsi ( s . formatted ) , subset . values [ i ] . formatted ) ;
6161 }
6262 } else {
@@ -279,7 +279,7 @@ test('.is()', t => {
279279 message : '' ,
280280 raw : { actual : 'foo' , expected : 'bar' } ,
281281 values : [
282- { label : 'Difference:' , formatted : / - ' f o o ' \n \+ ' b a r ' / } ,
282+ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ ' b a r ' / } ,
283283 ] ,
284284 } ) ;
285285
@@ -289,31 +289,31 @@ test('.is()', t => {
289289 expected : 42 ,
290290 message : '' ,
291291 values : [
292- { label : 'Difference:' , formatted : / - ' f o o ' \n \+ 4 2 / } ,
292+ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ 4 2 / } ,
293293 ] ,
294294 } ) ;
295295
296296 failsWith ( t , ( ) => assertions . is ( 'foo' , 42 , 'my message' ) , {
297297 assertion : 'is' ,
298298 message : 'my message' ,
299299 values : [
300- { label : 'Difference:' , formatted : / - ' f o o ' \n \+ 4 2 / } ,
300+ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ 4 2 / } ,
301301 ] ,
302302 } ) ;
303303
304304 failsWith ( t , ( ) => assertions . is ( 0 , - 0 , 'my message' ) , {
305305 assertion : 'is' ,
306306 message : 'my message' ,
307307 values : [
308- { label : 'Difference:' , formatted : / - 0 \n \+ - 0 / } ,
308+ { label : 'Difference (- actual, + expected) :' , formatted : / - 0 \n \+ - 0 / } ,
309309 ] ,
310310 } ) ;
311311
312312 failsWith ( t , ( ) => assertions . is ( - 0 , 0 , 'my message' ) , {
313313 assertion : 'is' ,
314314 message : 'my message' ,
315315 values : [
316- { label : 'Difference:' , formatted : / - - 0 \n \+ 0 / } ,
316+ { label : 'Difference (- actual, + expected) :' , formatted : / - - 0 \n \+ 0 / } ,
317317 ] ,
318318 } ) ;
319319
@@ -535,20 +535,20 @@ test('.deepEqual()', t => {
535535 assertion : 'deepEqual' ,
536536 message : '' ,
537537 raw : { actual : 'foo' , expected : 'bar' } ,
538- values : [ { label : 'Difference:' , formatted : / - ' f o o ' \n \+ ' b a r ' / } ] ,
538+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ ' b a r ' / } ] ,
539539 } ) ;
540540
541541 failsWith ( t , ( ) => assertions . deepEqual ( 'foo' , 42 ) , {
542542 assertion : 'deepEqual' ,
543543 message : '' ,
544544 raw : { actual : 'foo' , expected : 42 } ,
545- values : [ { label : 'Difference:' , formatted : / - ' f o o ' \n \+ 4 2 / } ] ,
545+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ 4 2 / } ] ,
546546 } ) ;
547547
548548 failsWith ( t , ( ) => assertions . deepEqual ( 'foo' , 42 , 'my message' ) , {
549549 assertion : 'deepEqual' ,
550550 message : 'my message' ,
551- values : [ { label : 'Difference:' , formatted : / - ' f o o ' \n \+ 4 2 / } ] ,
551+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : / - ' f o o ' \n \+ 4 2 / } ] ,
552552 } ) ;
553553
554554 failsWith ( t , ( ) => assertions . deepEqual ( { } , { } , null ) , {
@@ -758,7 +758,7 @@ test('.like()', t => {
758758 failsWith ( t , ( ) => assertions . like ( { a : 'foo' , b : 'irrelevant' } , { a : 'bar' } ) , {
759759 assertion : 'like' ,
760760 message : '' ,
761- values : [ { label : 'Difference:' , formatted : / { \n - \s * a : ' f o o ' , \n \+ \s * a : ' b a r ' , \n \s * } / } ] ,
761+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : / { \n - \s * a : ' f o o ' , \n \+ \s * a : ' b a r ' , \n \s * } / } ] ,
762762 } ) ;
763763
764764 t . end ( ) ;
@@ -1429,7 +1429,7 @@ test('.snapshot()', async t => {
14291429 failsWith ( t , ( ) => assertions . snapshot ( { foo : 'not bar' } ) , {
14301430 assertion : 'snapshot' ,
14311431 message : 'Did not match snapshot' ,
1432- values : [ { label : 'Difference:' , formatted : ' {\n- foo: \'not bar\',\n+ foo: \'bar\',\n }' } ] ,
1432+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : ' {\n- foo: \'not bar\',\n+ foo: \'bar\',\n }' } ] ,
14331433 } ) ;
14341434 }
14351435
@@ -1442,7 +1442,7 @@ test('.snapshot()', async t => {
14421442 failsWith ( t , ( ) => assertions . snapshot ( { foo : 'not bar' } , 'my message' ) , {
14431443 assertion : 'snapshot' ,
14441444 message : 'my message' ,
1445- values : [ { label : 'Difference:' , formatted : ' {\n- foo: \'not bar\',\n+ foo: \'bar\',\n }' } ] ,
1445+ values : [ { label : 'Difference (- actual, + expected) :' , formatted : ' {\n- foo: \'not bar\',\n+ foo: \'bar\',\n }' } ] ,
14461446 } ) ;
14471447 }
14481448
0 commit comments