@@ -33,15 +33,13 @@ describe('Mocked', () => {
33
33
> ( ) ;
34
34
35
35
expect (
36
- MockSomeClass . prototype . methodA . mockReturnValue ( 'true' ) ,
37
- ) . type . toRaiseError ( ) ;
36
+ MockSomeClass . prototype . methodA . mockReturnValue ,
37
+ ) . type . not . toBeCallableWith ( 'true' ) ;
38
38
expect (
39
- MockSomeClass . prototype . methodB . mockImplementation (
40
- ( a : string , b ?: string ) => {
41
- return ;
42
- } ,
43
- ) ,
44
- ) . type . toRaiseError ( ) ;
39
+ MockSomeClass . prototype . methodB . mockImplementation ,
40
+ ) . type . not . toBeCallableWith ( ( a : string , b ?: string ) => {
41
+ return ;
42
+ } ) ;
45
43
46
44
expect ( MockSomeClass . mock . instances [ 0 ] . methodA . mock . calls [ 0 ] ) . type . toBe <
47
45
[ ]
@@ -59,14 +57,14 @@ describe('Mocked', () => {
59
57
[ a : string , b ?: number ]
60
58
> ( ) ;
61
59
60
+ expect ( mockSomeInstance . methodA . mockReturnValue ) . type . not . toBeCallableWith (
61
+ 'true' ,
62
+ ) ;
62
63
expect (
63
- mockSomeInstance . methodA . mockReturnValue ( 'true' ) ,
64
- ) . type . toRaiseError ( ) ;
65
- expect (
66
- mockSomeInstance . methodB . mockImplementation ( ( a : string , b ?: string ) => {
67
- return ;
68
- } ) ,
69
- ) . type . toRaiseError ( ) ;
64
+ mockSomeInstance . methodB . mockImplementation ,
65
+ ) . type . not . toBeCallableWith ( ( a : string , b ?: string ) => {
66
+ return ;
67
+ } ) ;
70
68
71
69
expect ( new SomeClass ( 'sample' ) ) . type . toBeAssignableWith ( mockSomeInstance ) ;
72
70
} ) ;
@@ -80,10 +78,10 @@ describe('Mocked', () => {
80
78
81
79
expect ( mockFunction . mock . calls [ 0 ] ) . type . toBe < [ a : string , b ?: number ] > ( ) ;
82
80
83
- expect ( mockFunction . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
84
- expect (
85
- mockFunction . mockImplementation ( ( a : boolean , b ?: number ) => true ) ,
86
- ) . type . toRaiseError ( ) ;
81
+ expect ( mockFunction . mockReturnValue ) . type . not . toBeCallableWith ( 123 ) ;
82
+ expect ( mockFunction . mockImplementation ) . type . not . toBeCallableWith (
83
+ ( a : boolean , b ?: number ) => true ,
84
+ ) ;
87
85
88
86
expect ( someFunction ) . type . toBeAssignableWith ( mockFunction ) ;
89
87
} ) ;
@@ -99,12 +97,10 @@ describe('Mocked', () => {
99
97
100
98
expect ( mockAsyncFunction . mock . calls [ 0 ] ) . type . toBe < [ Array < boolean > ] > ( ) ;
101
99
102
- expect ( mockAsyncFunction . mockResolvedValue ( 123 ) ) . type . toRaiseError ( ) ;
103
- expect (
104
- mockAsyncFunction . mockImplementation ( ( a : Array < boolean > ) =>
105
- Promise . resolve ( true ) ,
106
- ) ,
107
- ) . type . toRaiseError ( ) ;
100
+ expect ( mockAsyncFunction . mockResolvedValue ) . type . not . toBeCallableWith ( 123 ) ;
101
+ expect ( mockAsyncFunction . mockImplementation ) . type . not . toBeCallableWith (
102
+ ( a : Array < boolean > ) => Promise . resolve ( true ) ,
103
+ ) ;
108
104
109
105
expect ( someAsyncFunction ) . type . toBeAssignableWith ( mockAsyncFunction ) ;
110
106
} ) ;
@@ -130,23 +126,23 @@ describe('Mocked', () => {
130
126
[ a : number , b ?: string ]
131
127
> ( ) ;
132
128
133
- expect ( mockFunctionObject . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
134
- expect (
135
- mockFunctionObject . mockImplementation ( ( ) => true ) ,
136
- ) . type . toRaiseError ( ) ;
129
+ expect ( mockFunctionObject . mockReturnValue ) . type . not . toBeCallableWith ( 123 ) ;
130
+ expect ( mockFunctionObject . mockImplementation ) . type . not . toBeCallableWith (
131
+ ( ) => true ,
132
+ ) ;
137
133
138
134
expect ( mockFunctionObject . one . more . time . mock . calls [ 0 ] ) . type . toBe <
139
135
[ time : number ]
140
136
> ( ) ;
141
137
142
138
expect (
143
- mockFunctionObject . one . more . time . mockReturnValue ( 123 ) ,
144
- ) . type . toRaiseError ( ) ;
139
+ mockFunctionObject . one . more . time . mockReturnValue ,
140
+ ) . type . not . toBeCallableWith ( 123 ) ;
145
141
expect (
146
- mockFunctionObject . one . more . time . mockImplementation ( ( time : string ) => {
147
- return ;
148
- } ) ,
149
- ) . type . toRaiseError ( ) ;
142
+ mockFunctionObject . one . more . time . mockImplementation ,
143
+ ) . type . not . toBeCallableWith ( ( time : string ) => {
144
+ return ;
145
+ } ) ;
150
146
151
147
expect ( someFunctionObject ) . type . toBeAssignableWith ( mockFunctionObject ) ;
152
148
} ) ;
@@ -211,57 +207,51 @@ describe('Mocked', () => {
211
207
[ a : string , b ?: number ]
212
208
> ( ) ;
213
209
214
- expect ( mockObject . methodA . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
215
- expect (
216
- mockObject . methodA . mockImplementation ( ( a : number ) => 123 ) ,
217
- ) . type . toRaiseError ( ) ;
218
- expect ( mockObject . methodB . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
219
- expect (
220
- mockObject . methodB . mockImplementation ( ( b : number ) => 123 ) ,
221
- ) . type . toRaiseError ( ) ;
222
- expect ( mockObject . methodC . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
223
- expect (
224
- mockObject . methodC . mockImplementation ( ( c : number ) => 123 ) ,
225
- ) . type . toRaiseError ( ) ;
210
+ expect ( mockObject . methodA . mockReturnValue ) . type . not . toBeCallableWith ( 123 ) ;
211
+ expect ( mockObject . methodA . mockImplementation ) . type . not . toBeCallableWith (
212
+ ( a : number ) => 123 ,
213
+ ) ;
214
+ expect ( mockObject . methodB . mockReturnValue ) . type . not . toBeCallableWith ( 123 ) ;
215
+ expect ( mockObject . methodB . mockImplementation ) . type . not . toBeCallableWith (
216
+ ( b : number ) => 123 ,
217
+ ) ;
218
+ expect ( mockObject . methodC . mockReturnValue ) . type . not . toBeCallableWith ( 123 ) ;
219
+ expect ( mockObject . methodC . mockImplementation ) . type . not . toBeCallableWith (
220
+ ( c : number ) => 123 ,
221
+ ) ;
226
222
227
- expect ( mockObject . one . more . time . mockReturnValue ( 123 ) ) . type . toRaiseError ( ) ;
223
+ expect ( mockObject . one . more . time . mockReturnValue ) . type . not . toBeCallableWith (
224
+ 123 ,
225
+ ) ;
228
226
expect (
229
- mockObject . one . more . time . mockImplementation ( ( t : boolean ) => 123 ) ,
230
- ) . type . toRaiseError ( ) ;
227
+ mockObject . one . more . time . mockImplementation ,
228
+ ) . type . not . toBeCallableWith ( ( t : boolean ) => 123 ) ;
231
229
232
230
expect (
233
- mockObject . SomeClass . prototype . methodA . mockReturnValue ( 123 ) ,
234
- ) . type . toRaiseError ( ) ;
231
+ mockObject . SomeClass . prototype . methodA . mockReturnValue ,
232
+ ) . type . not . toBeCallableWith ( 123 ) ;
235
233
expect (
236
- mockObject . SomeClass . prototype . methodA . mockImplementation (
237
- ( a : number ) => 123 ,
238
- ) ,
239
- ) . type . toRaiseError ( ) ;
234
+ mockObject . SomeClass . prototype . methodA . mockImplementation ,
235
+ ) . type . not . toBeCallableWith ( ( a : number ) => 123 ) ;
240
236
expect (
241
- mockObject . SomeClass . prototype . methodB . mockReturnValue ( 123 ) ,
242
- ) . type . toRaiseError ( ) ;
237
+ mockObject . SomeClass . prototype . methodB . mockReturnValue ,
238
+ ) . type . not . toBeCallableWith ( 123 ) ;
243
239
expect (
244
- mockObject . SomeClass . prototype . methodB . mockImplementation (
245
- ( a : number ) => 123 ,
246
- ) ,
247
- ) . type . toRaiseError ( ) ;
240
+ mockObject . SomeClass . prototype . methodB . mockImplementation ,
241
+ ) . type . not . toBeCallableWith ( ( a : number ) => 123 ) ;
248
242
249
243
expect (
250
- mockObject . someClassInstance . methodA . mockReturnValue ( 123 ) ,
251
- ) . type . toRaiseError ( ) ;
244
+ mockObject . someClassInstance . methodA . mockReturnValue ,
245
+ ) . type . not . toBeCallableWith ( 123 ) ;
252
246
expect (
253
- mockObject . someClassInstance . methodA . mockImplementation (
254
- ( a : number ) => 123 ,
255
- ) ,
256
- ) . type . toRaiseError ( ) ;
247
+ mockObject . someClassInstance . methodA . mockImplementation ,
248
+ ) . type . not . toBeCallableWith ( ( a : number ) => 123 ) ;
257
249
expect (
258
- mockObject . someClassInstance . methodB . mockReturnValue ( 123 ) ,
259
- ) . type . toRaiseError ( ) ;
250
+ mockObject . someClassInstance . methodB . mockReturnValue ,
251
+ ) . type . not . toBeCallableWith ( 123 ) ;
260
252
expect (
261
- mockObject . someClassInstance . methodB . mockImplementation (
262
- ( a : number ) => 123 ,
263
- ) ,
264
- ) . type . toRaiseError ( ) ;
253
+ mockObject . someClassInstance . methodB . mockImplementation ,
254
+ ) . type . not . toBeCallableWith ( ( a : number ) => 123 ) ;
265
255
266
256
expect ( someObject ) . type . toBeAssignableWith ( mockObject ) ;
267
257
} ) ;
0 commit comments