Skip to content

Commit

Permalink
refactor: use jest.advanceTimersByTime in async test
Browse files Browse the repository at this point in the history
`jest.runTimersToTime` is deprecated and removed in jest 27
  • Loading branch information
cexbrayat committed Jul 20, 2021
1 parent a1e1e23 commit 96b8579
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/features/async-components.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ describe('defineAsyncComponent', () => {
})

const wrapper = mount(Comp, { global: { config } })
jest.runTimersToTime(35)
jest.advanceTimersByTime(35)
await flushPromises()
expect(wrapper.html()).toContain('Loading Component')

jest.runTimersToTime(100)
jest.advanceTimersByTime(100)
await flushPromises()
expect(wrapper.html()).toContain('Async Component')
})
Expand Down

0 comments on commit 96b8579

Please sign in to comment.