Skip to content

Commit b9846b0

Browse files
aryaemami59markerikson
authored andcommitted
Change .toHaveBeenCalledTimes(0) to .not.toHaveBeenCalled()
1 parent 2de88c0 commit b9846b0

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

test/components/Provider.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ describe('React', () => {
8080
<Child />
8181
</Provider>,
8282
)
83-
expect(spy).toHaveBeenCalledTimes(0)
83+
expect(spy).not.toHaveBeenCalled()
8484
spy.mockRestore()
8585

8686
expect(tester.getByTestId('store')).toHaveTextContent(
@@ -344,7 +344,7 @@ describe('React', () => {
344344
</Provider>,
345345
)
346346

347-
expect(spy).toHaveBeenCalledTimes(0)
347+
expect(spy).not.toHaveBeenCalled()
348348

349349
unmount()
350350

test/components/connect.spec.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ describe('React', () => {
204204
<ConnectedContainer />
205205
</ProviderMock>,
206206
)
207-
expect(spy).toHaveBeenCalledTimes(0)
207+
expect(spy).not.toHaveBeenCalled()
208208
spy.mockRestore()
209209

210210
expect(tester.getByTestId('string')).toHaveTextContent('')
@@ -247,7 +247,7 @@ describe('React', () => {
247247
<ConnectedContainer />
248248
</ProviderMock>,
249249
)
250-
expect(spy).toHaveBeenCalledTimes(0)
250+
expect(spy).not.toHaveBeenCalled()
251251
spy.mockRestore()
252252

253253
expect(tester.getByTestId('string')).toHaveTextContent('')
@@ -1310,7 +1310,7 @@ describe('React', () => {
13101310
// TODO Getting4 instead of 3
13111311
// expect(mapStateToPropsCalls).toBe(3)
13121312
expect(mapStateToPropsCalls).toBe(4)
1313-
expect(spy).toHaveBeenCalledTimes(0)
1313+
expect(spy).not.toHaveBeenCalled()
13141314
spy.mockRestore()
13151315
})
13161316

@@ -1345,7 +1345,7 @@ describe('React', () => {
13451345

13461346
const spy = vi.spyOn(console, 'error').mockImplementation(() => {})
13471347
unmount()
1348-
expect(spy).toHaveBeenCalledTimes(0)
1348+
expect(spy).not.toHaveBeenCalled()
13491349
expect(mapStateToPropsCalls).toBe(1)
13501350
spy.mockRestore()
13511351
})
@@ -1383,7 +1383,7 @@ describe('React', () => {
13831383
store.dispatch({ type: 'APPEND', body: 'a' })
13841384
})
13851385

1386-
expect(spy).toHaveBeenCalledTimes(0)
1386+
expect(spy).not.toHaveBeenCalled()
13871387
expect(mapStateToPropsCalls).toBe(1)
13881388
spy.mockRestore()
13891389
})
@@ -2110,7 +2110,7 @@ describe('React', () => {
21102110
</ProviderMock>,
21112111
)
21122112

2113-
expect(mapStateToProps).toHaveBeenCalledTimes(0)
2113+
expect(mapStateToProps).not.toHaveBeenCalled()
21142114
rtl.act(() => {
21152115
store.dispatch({ type: 'INC' })
21162116
})

test/integration/server-rendering.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('React', () => {
105105
</Provider>,
106106
)
107107

108-
expect(spy).toHaveBeenCalledTimes(0)
108+
expect(spy).not.toHaveBeenCalled()
109109

110110
spy.mockRestore()
111111
})

0 commit comments

Comments
 (0)