Commit f629b57
committed
Enhance test reliability with fake timers in index.test.ts
- Implemented fake timers using vi.useFakeTimers() to control setTimeout behavior during tests.
- Restored real timers and cleared pending timers in afterEach to ensure a clean test environment.
These changes improve the reliability of tests by preventing unintended delays and ensuring proper timer management.1 parent 9345894 commit f629b57
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
14 | 16 | | |
15 | 17 | | |
16 | 18 | | |
| 19 | + | |
| 20 | + | |
17 | 21 | | |
18 | 22 | | |
19 | 23 | | |
| |||
0 commit comments