@@ -121,13 +121,19 @@ test('class method received', t => {
121121 t . notThrows ( ( ) => substitute . received ( 1 ) . c ( 'hi' , 'the1re' ) )
122122 t . notThrows ( ( ) => substitute . received ( ) . c ( 'hi' , 'there' ) )
123123
124- const expectedMessage = 'Expected 7 calls to the method c with arguments [\'hi\', \'there\'], but received 4 of such calls.\n' +
125- 'All calls received to method c:\n' +
126- '-> call with arguments [\'hi\', \'there\']\n' +
127- '-> call with arguments [\'hi\', \'the1re\']\n' +
128- '-> call with arguments [\'hi\', \'there\']\n' +
129- '-> call with arguments [\'hi\', \'there\']\n' +
130- '-> call with arguments [\'hi\', \'there\']'
124+ const expectedMessage = 'Call count mismatch in @Substitute.c:\n' +
125+ `Expected to receive 7 method calls matching c('hi', 'there'), but received 4.\n` +
126+ 'All property or method calls to @Substitute.c received so far:\n' +
127+ `› ✔ @Substitute.c('hi', 'there')\n` +
128+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:114:18)\n` +
129+ `› ✘ @Substitute.c('hi', 'the1re')\n` +
130+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:115:18)\n` +
131+ `› ✔ @Substitute.c('hi', 'there')\n` +
132+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:116:18)\n` +
133+ `› ✔ @Substitute.c('hi', 'there')\n` +
134+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:117:18)\n` +
135+ `› ✔ @Substitute.c('hi', 'there')\n` +
136+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:118:18)\n`
131137 const { message } = t . throws ( ( ) => { substitute . received ( 7 ) . c ( 'hi' , 'there' ) } )
132138 t . is ( message . replace ( textModifierRegex , '' ) , expectedMessage )
133139} )
@@ -142,9 +148,11 @@ test('received call matches after partial mocks using property instance mimicks'
142148 substitute . received ( 1 ) . c ( 'lala' , 'bar' )
143149
144150 t . notThrows ( ( ) => substitute . received ( 1 ) . c ( 'lala' , 'bar' ) )
145- const expectedMessage = 'Expected 2 calls to the method c with arguments [\'lala\', \'bar\'], but received 1 of such calls.\n' +
146- 'All calls received to method c:\n' +
147- '-> call with arguments [\'lala\', \'bar\']'
151+ const expectedMessage = 'Call count mismatch in @Substitute.c:\n' +
152+ `Expected to receive 2 method calls matching c('lala', 'bar'), but received 1.\n` +
153+ 'All property or method calls to @Substitute.c received so far:\n' +
154+ `› ✔ @Substitute.c('lala', 'bar')\n` +
155+ ` called at <anonymous> (${ process . cwd ( ) } /spec/regression/index.test.ts:145:13)\n`
148156 const { message } = t . throws ( ( ) => substitute . received ( 2 ) . c ( 'lala' , 'bar' ) )
149157 t . is ( message . replace ( textModifierRegex , '' ) , expectedMessage )
150158 t . deepEqual ( substitute . d , 1337 )
0 commit comments