@@ -121,13 +121,19 @@ test('class method received', t => {
121
121
t . notThrows ( ( ) => substitute . received ( 1 ) . c ( 'hi' , 'the1re' ) )
122
122
t . notThrows ( ( ) => substitute . received ( ) . c ( 'hi' , 'there' ) )
123
123
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`
131
137
const { message } = t . throws ( ( ) => { substitute . received ( 7 ) . c ( 'hi' , 'there' ) } )
132
138
t . is ( message . replace ( textModifierRegex , '' ) , expectedMessage )
133
139
} )
@@ -142,9 +148,11 @@ test('received call matches after partial mocks using property instance mimicks'
142
148
substitute . received ( 1 ) . c ( 'lala' , 'bar' )
143
149
144
150
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`
148
156
const { message } = t . throws ( ( ) => substitute . received ( 2 ) . c ( 'lala' , 'bar' ) )
149
157
t . is ( message . replace ( textModifierRegex , '' ) , expectedMessage )
150
158
t . deepEqual ( substitute . d , 1337 )
0 commit comments