Commit f276ba6
committed
refactor: migrate test runner from bun:test to vitest (WIP)
Phase 3 of Bun → Node.js migration. Migrates 327 test files from
bun:test to vitest.
Mechanical changes:
- bun:test imports → vitest imports (327 files)
- mock → vi, spyOn → vi.spyOn, mock.module → vi.mock (52 files)
- Bun.spawn/spawnSync → node:child_process in test files (12 files)
- Bun.file/write/sleep/gzip/etc → Node.js equivalents in tests (40 files)
- Bun.serve → node:http createServer in test mock server
- import.meta.dir → import.meta.dirname (16 files)
- BUN_TEST_WORKER_ID → VITEST_POOL_ID
- Added vitest.config.ts with setupFiles, pool: forks, 15s timeout
- Added custom toStartWith/toEndWith matchers in preload.ts
- Removed bun:sqlite fallback from sqlite.ts
- Updated package.json test scripts to use vitest
Known remaining issues (WIP):
- ESM spy limitations (Cannot spy on ESM namespace exports)
- Some vi import gaps in edge cases
- Test API signature changes (vitest 4)
- self is not defined in model-based tests1 parent 1c97cbf commit f276ba6
344 files changed
Lines changed: 5797 additions & 3113 deletions
File tree
- src/lib
- db
- test
- commands
- auth
- cli
- dashboard
- widget
- event
- issue
- log
- project
- release
- replay
- repo
- sourcemap
- span
- team
- trace
- trial
- e2e
- fixtures/bench
- init-eval/helpers
- lib
- api
- bench
- db
- dsn
- formatters
- init
- tools
- ui
- scan
- security
- sourcemap
- telemetry
- mocks
- script
- skill-eval/helpers
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 31 | + | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
45 | 44 | | |
46 | 45 | | |
47 | 46 | | |
48 | | - | |
| 47 | + | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
| 60 | + | |
| 61 | + | |
84 | 62 | | |
85 | 63 | | |
86 | 64 | | |
| |||
106 | 84 | | |
107 | 85 | | |
108 | 86 | | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | 87 | | |
113 | 88 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
| 89 | + | |
119 | 90 | | |
120 | 91 | | |
121 | 92 | | |
| |||
128 | 99 | | |
129 | 100 | | |
130 | 101 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | 102 | | |
136 | 103 | | |
137 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
409 | 409 | | |
410 | 410 | | |
411 | 411 | | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
425 | 427 | | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
426 | 433 | | |
427 | 434 | | |
428 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | 136 | | |
139 | 137 | | |
140 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
1010 | 1011 | | |
1011 | 1012 | | |
1012 | 1013 | | |
1013 | | - | |
| 1014 | + | |
1014 | 1015 | | |
1015 | 1016 | | |
1016 | 1017 | | |
| |||
1028 | 1029 | | |
1029 | 1030 | | |
1030 | 1031 | | |
1031 | | - | |
| 1032 | + | |
1032 | 1033 | | |
1033 | 1034 | | |
1034 | 1035 | | |
| |||
0 commit comments