-
-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathplugin.test.ts
More file actions
673 lines (631 loc) · 23.5 KB
/
plugin.test.ts
File metadata and controls
673 lines (631 loc) · 23.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
import * as fs from 'node:fs'
import { join, resolve } from 'node:path'
import * as wasm from '@devup-ui/wasm'
import * as webpackPluginModule from '@devup-ui/webpack-plugin'
import {
afterEach,
beforeEach,
describe,
expect,
it,
mock,
spyOn,
} from 'bun:test'
import * as coordinatorModule from '../coordinator'
import { DevupUI } from '../plugin'
let existsSyncSpy: ReturnType<typeof spyOn>
let mkdirSyncSpy: ReturnType<typeof spyOn>
let readFileSyncSpy: ReturnType<typeof spyOn>
let writeFileSyncSpy: ReturnType<typeof spyOn>
let unlinkSyncSpy: ReturnType<typeof spyOn>
let getDefaultThemeSpy: ReturnType<typeof spyOn>
let getThemeInterfaceSpy: ReturnType<typeof spyOn>
let setPrefixSpy: ReturnType<typeof spyOn>
let registerThemeSpy: ReturnType<typeof spyOn>
let getCssSpy: ReturnType<typeof spyOn>
let importSheetSpy: ReturnType<typeof spyOn>
let importClassMapSpy: ReturnType<typeof spyOn>
let importFileMapSpy: ReturnType<typeof spyOn>
let exportSheetSpy: ReturnType<typeof spyOn>
let exportClassMapSpy: ReturnType<typeof spyOn>
let exportFileMapSpy: ReturnType<typeof spyOn>
let devupUIWebpackPluginSpy: ReturnType<typeof spyOn>
let startCoordinatorSpy: ReturnType<typeof spyOn>
let originalEnv: NodeJS.ProcessEnv
let originalFetch: typeof global.fetch
let originalDebugPort: number
beforeEach(() => {
existsSyncSpy = spyOn(fs, 'existsSync').mockReturnValue(false)
mkdirSyncSpy = spyOn(fs, 'mkdirSync').mockReturnValue('' as any)
readFileSyncSpy = spyOn(fs, 'readFileSync').mockReturnValue('{}')
writeFileSyncSpy = spyOn(fs, 'writeFileSync').mockReturnValue(undefined)
unlinkSyncSpy = spyOn(fs, 'unlinkSync').mockReturnValue(undefined)
getDefaultThemeSpy = spyOn(wasm, 'getDefaultTheme').mockReturnValue(undefined)
getThemeInterfaceSpy = spyOn(wasm, 'getThemeInterface').mockReturnValue('')
setPrefixSpy = spyOn(wasm, 'setPrefix').mockReturnValue(undefined)
registerThemeSpy = spyOn(wasm, 'registerTheme').mockReturnValue(undefined)
getCssSpy = spyOn(wasm, 'getCss').mockReturnValue('')
importSheetSpy = spyOn(wasm, 'importSheet').mockReturnValue(undefined)
importClassMapSpy = spyOn(wasm, 'importClassMap').mockReturnValue(undefined)
importFileMapSpy = spyOn(wasm, 'importFileMap').mockReturnValue(undefined)
exportSheetSpy = spyOn(wasm, 'exportSheet').mockReturnValue(
JSON.stringify({
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
}),
)
exportClassMapSpy = spyOn(wasm, 'exportClassMap').mockReturnValue(
JSON.stringify({}),
)
exportFileMapSpy = spyOn(wasm, 'exportFileMap').mockReturnValue(
JSON.stringify({}),
)
devupUIWebpackPluginSpy = spyOn(
webpackPluginModule,
'DevupUIWebpackPlugin',
).mockImplementation(mock() as never)
startCoordinatorSpy = spyOn(
coordinatorModule,
'startCoordinator',
).mockReturnValue({ close: mock() as () => void })
originalEnv = { ...process.env }
originalFetch = global.fetch
originalDebugPort = process.debugPort
global.fetch = mock(() => Promise.resolve({} as Response)) as any
})
afterEach(() => {
process.env = originalEnv
global.fetch = originalFetch
process.debugPort = originalDebugPort
existsSyncSpy.mockRestore()
mkdirSyncSpy.mockRestore()
readFileSyncSpy.mockRestore()
writeFileSyncSpy.mockRestore()
unlinkSyncSpy.mockRestore()
getDefaultThemeSpy.mockRestore()
getThemeInterfaceSpy.mockRestore()
setPrefixSpy.mockRestore()
registerThemeSpy.mockRestore()
getCssSpy.mockRestore()
importSheetSpy.mockRestore()
importClassMapSpy.mockRestore()
importFileMapSpy.mockRestore()
exportSheetSpy.mockRestore()
exportClassMapSpy.mockRestore()
exportFileMapSpy.mockRestore()
devupUIWebpackPluginSpy.mockRestore()
startCoordinatorSpy.mockRestore()
})
describe('DevupUINextPlugin', () => {
describe('webpack', () => {
it('should apply webpack plugin', async () => {
const ret = DevupUI({})
ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId' } as any)
expect(devupUIWebpackPluginSpy).toHaveBeenCalledWith({
cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'),
})
})
it('should apply webpack plugin with dev', async () => {
const ret = DevupUI({})
ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId', dev: true } as any)
expect(devupUIWebpackPluginSpy).toHaveBeenCalledWith({
cssDir: resolve('df', 'devup-ui_tmpBuildId'),
watch: true,
})
})
it('should apply webpack plugin with config', async () => {
const ret = DevupUI(
{},
{
package: 'new-package',
},
)
ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId' } as any)
expect(devupUIWebpackPluginSpy).toHaveBeenCalledWith({
package: 'new-package',
cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'),
})
})
it('should apply webpack plugin with webpack obj', async () => {
const webpack = mock()
const ret = DevupUI(
{
webpack,
},
{
package: 'new-package',
},
)
ret.webpack!({ plugins: [] }, { buildId: 'tmpBuildId' } as any)
expect(devupUIWebpackPluginSpy).toHaveBeenCalledWith({
package: 'new-package',
cssDir: resolve('.next/cache', 'devup-ui_tmpBuildId'),
})
expect(webpack).toHaveBeenCalled()
})
})
describe('turbo', () => {
it('should apply turbo config', async () => {
process.env.TURBOPACK = '1'
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
const ret = DevupUI({})
expect(ret).toEqual({
turbopack: {
rules: {
'./df/devup-ui/*.css': [
{
loader: '@devup-ui/next-plugin/css-loader',
options: {
watch: false,
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
themeFile: 'devup.json',
theme: {},
defaultClassMap: {},
defaultFileMap: {},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
},
},
],
'*.{tsx,ts,js,mjs}': {
loaders: [
{
loader: '@devup-ui/next-plugin/loader',
options: {
package: '@devup-ui/react',
cssDir: resolve('df', 'devup-ui'),
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
themeFile: 'devup.json',
watch: false,
singleCss: false,
theme: {},
defaultClassMap: {},
defaultFileMap: {},
importAliases: {
'@emotion/styled': 'styled',
'@vanilla-extract/css': null,
'styled-components': 'styled',
},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
},
},
],
condition: {
not: {
path: new RegExp(
`(node_modules(?!.*(${['@devup-ui']
.join('|')
.replaceAll(
'/',
'[\\/\\\\_]',
)})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`,
),
},
},
},
},
},
})
})
it('should apply turbo config with create df', async () => {
process.env.TURBOPACK = '1'
existsSyncSpy.mockReturnValue(false)
mkdirSyncSpy.mockReturnValue('')
writeFileSyncSpy.mockReturnValue(undefined)
const ret = DevupUI({})
expect(ret).toEqual({
turbopack: {
rules: {
'./df/devup-ui/*.css': [
{
loader: '@devup-ui/next-plugin/css-loader',
options: {
watch: false,
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
themeFile: 'devup.json',
theme: {},
defaultClassMap: {},
defaultFileMap: {},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
},
},
],
'*.{tsx,ts,js,mjs}': {
condition: {
not: {
path: new RegExp(
`(node_modules(?!.*(${['@devup-ui']
.join('|')
.replaceAll(
'/',
'[\\/\\\\_]',
)})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`,
),
},
},
loaders: [
{
loader: '@devup-ui/next-plugin/loader',
options: {
package: '@devup-ui/react',
cssDir: resolve('df', 'devup-ui'),
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
importAliases: {
'@emotion/styled': 'styled',
'@vanilla-extract/css': null,
'styled-components': 'styled',
},
watch: false,
singleCss: false,
theme: {},
defaultClassMap: {},
defaultFileMap: {},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
themeFile: 'devup.json',
},
},
],
},
},
},
})
expect(mkdirSyncSpy).toHaveBeenCalledWith('df', {
recursive: true,
})
expect(writeFileSyncSpy).toHaveBeenCalledWith(
join('df', '.gitignore'),
'*',
)
})
it('should apply turbo config with exists df and devup.json', async () => {
process.env.TURBOPACK = '1'
existsSyncSpy.mockReturnValue(true)
readFileSyncSpy.mockReturnValue(JSON.stringify({ theme: 'theme' }))
mkdirSyncSpy.mockReturnValue('')
writeFileSyncSpy.mockReturnValue(undefined)
const ret = DevupUI({})
expect(ret).toEqual({
turbopack: {
rules: {
'./df/devup-ui/*.css': [
{
loader: '@devup-ui/next-plugin/css-loader',
options: {
watch: false,
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
themeFile: 'devup.json',
theme: 'theme',
defaultClassMap: {},
defaultFileMap: {},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
},
},
],
'*.{tsx,ts,js,mjs}': {
condition: {
not: {
path: new RegExp(
`(node_modules(?!.*(${['@devup-ui']
.join('|')
.replaceAll(
'/',
'[\\/\\\\_]',
)})([\\/\\\\.]|$)))|(.mdx.[tj]sx?$)`,
),
},
},
loaders: [
{
loader: '@devup-ui/next-plugin/loader',
options: {
package: '@devup-ui/react',
cssDir: resolve('df', 'devup-ui'),
coordinatorPortFile: join('df', 'coordinator.port'),
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
watch: false,
singleCss: false,
theme: 'theme',
defaultClassMap: {},
defaultFileMap: {},
importAliases: {
'@emotion/styled': 'styled',
'@vanilla-extract/css': null,
'styled-components': 'styled',
},
defaultSheet: {
css: {},
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
},
themeFile: 'devup.json',
},
},
],
},
},
},
})
// mkdirSync is NOT called when existsSync returns true
expect(mkdirSyncSpy).not.toHaveBeenCalled()
// gitignore is also NOT written when it exists
expect(writeFileSyncSpy).not.toHaveBeenCalledWith(
join('df', '.gitignore'),
'*',
)
})
it('should start coordinator even in production mode', () => {
;(process.env as any).NODE_ENV = 'production'
process.env.TURBOPACK = '1'
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
const ret = DevupUI({})
expect(ret).toEqual({
turbopack: {
rules: expect.any(Object),
},
})
expect(startCoordinatorSpy).toHaveBeenCalledWith({
package: '@devup-ui/react',
cssDir: resolve('df', 'devup-ui'),
singleCss: false,
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
importAliases: {
'@emotion/styled': 'styled',
'@vanilla-extract/css': null,
'styled-components': 'styled',
},
coordinatorPortFile: join('df', 'coordinator.port'),
})
})
it('should create theme.d.ts file', async () => {
process.env.TURBOPACK = '1'
existsSyncSpy.mockReturnValue(true)
getThemeInterfaceSpy.mockReturnValue('interface code')
readFileSyncSpy.mockReturnValue(JSON.stringify({ theme: 'theme' }))
mkdirSyncSpy.mockReturnValue('')
writeFileSyncSpy.mockReturnValue(undefined)
DevupUI({})
expect(writeFileSyncSpy).toHaveBeenCalledWith(
join('df', 'theme.d.ts'),
'interface code',
)
// mkdirSync is NOT called when existsSync returns true
expect(mkdirSyncSpy).not.toHaveBeenCalled()
})
it('should set DEVUP_UI_DEFAULT_THEME when getDefaultTheme returns a value', async () => {
process.env.TURBOPACK = '1'
process.env.DEVUP_UI_DEFAULT_THEME = ''
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
getDefaultThemeSpy.mockReturnValue('dark')
const config: any = {}
const ret = DevupUI(config)
expect(process.env.DEVUP_UI_DEFAULT_THEME).toBe('dark')
expect(ret.env).toEqual({
DEVUP_UI_DEFAULT_THEME: 'dark',
})
expect(config.env).toEqual({
DEVUP_UI_DEFAULT_THEME: 'dark',
})
})
it('should not set DEVUP_UI_DEFAULT_THEME when getDefaultTheme returns undefined', async () => {
process.env.TURBOPACK = '1'
process.env.DEVUP_UI_DEFAULT_THEME = ''
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
getDefaultThemeSpy.mockReturnValue(undefined)
const config: any = {}
const ret = DevupUI(config)
expect(process.env.DEVUP_UI_DEFAULT_THEME).toBe('')
expect(ret.env).toBeUndefined()
expect(config.env).toBeUndefined()
})
it('should set DEVUP_UI_DEFAULT_THEME and preserve existing env vars', async () => {
process.env.TURBOPACK = '1'
process.env.DEVUP_UI_DEFAULT_THEME = ''
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
getDefaultThemeSpy.mockReturnValue('light')
const config: any = {
env: {
CUSTOM_VAR: 'value',
},
}
const ret = DevupUI(config)
expect(process.env.DEVUP_UI_DEFAULT_THEME).toBe('light')
expect(ret.env).toEqual({
CUSTOM_VAR: 'value',
DEVUP_UI_DEFAULT_THEME: 'light',
})
expect(config.env).toEqual({
CUSTOM_VAR: 'value',
DEVUP_UI_DEFAULT_THEME: 'light',
})
})
it('should call setPrefix when prefix option is provided', async () => {
process.env.TURBOPACK = '1'
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
DevupUI({}, { prefix: 'my-prefix' })
expect(setPrefixSpy).toHaveBeenCalledWith('my-prefix')
})
it('should import previous session state on restart', () => {
process.env.TURBOPACK = '1'
existsSyncSpy
.mockReturnValueOnce(true) // distDir
.mockReturnValueOnce(true) // cssDir
.mockReturnValueOnce(true) // gitignoreFile
.mockReturnValueOnce(false) // devupFile in loadDevupConfigSync
// Simulate previous session state files on disk
const prevSheet = {
css: { a: 'color:red' },
font_faces: {},
global_css_files: [],
imports: {},
keyframes: {},
properties: {},
}
const prevClassMap = { a: 0 }
const prevFileMap = { 'src/App.tsx': 0 }
readFileSyncSpy
.mockReturnValueOnce(JSON.stringify(prevSheet)) // sheetFile
.mockReturnValueOnce(JSON.stringify(prevClassMap)) // classMapFile
.mockReturnValueOnce(JSON.stringify(prevFileMap)) // fileMapFile
DevupUI({})
// Verify previous state was imported before registerTheme
expect(importSheetSpy).toHaveBeenCalledWith(prevSheet)
expect(importClassMapSpy).toHaveBeenCalledWith(prevClassMap)
expect(importFileMapSpy).toHaveBeenCalledWith(prevFileMap)
expect(registerThemeSpy).toHaveBeenCalledWith({})
// Verify stale port file was deleted before starting coordinator
expect(unlinkSyncSpy).toHaveBeenCalledWith(join('df', 'coordinator.port'))
})
it('should handle missing state files gracefully on first run', () => {
process.env.TURBOPACK = '1'
existsSyncSpy
.mockReturnValueOnce(false) // distDir — doesn't exist
.mockReturnValueOnce(false) // cssDir
.mockReturnValueOnce(false) // gitignoreFile
.mockReturnValueOnce(false) // devupFile
// readFileSync throws for state files (they don't exist)
readFileSyncSpy.mockImplementation((path: string) => {
throw new Error(`ENOENT: no such file or directory, open '${path}'`)
})
// Should not throw — try-catch handles missing files
DevupUI({})
// importSheet should NOT have been called (readFileSync threw)
expect(importSheetSpy).not.toHaveBeenCalled()
expect(importClassMapSpy).not.toHaveBeenCalled()
expect(importFileMapSpy).not.toHaveBeenCalled()
// registerTheme should still be called with empty theme
expect(registerThemeSpy).toHaveBeenCalledWith({})
})
it('should start coordinator in development mode', async () => {
process.env.TURBOPACK = '1'
;(process.env as any).NODE_ENV = 'development'
existsSyncSpy
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(true)
.mockReturnValueOnce(false)
writeFileSyncSpy.mockReturnValue(undefined)
const closeMock = mock() as () => void
startCoordinatorSpy.mockReturnValue({ close: closeMock })
const exitHandlers: (() => void)[] = []
const processOnSpy = spyOn(process, 'on').mockImplementation(
(event: string, handler: (...args: unknown[]) => void) => {
if (event === 'exit') exitHandlers.push(handler as () => void)
return process
},
)
DevupUI({})
// Verify coordinator was started with correct options
expect(startCoordinatorSpy).toHaveBeenCalledWith({
package: '@devup-ui/react',
cssDir: resolve('df', 'devup-ui'),
singleCss: false,
sheetFile: join('df', 'sheet.json'),
classMapFile: join('df', 'classMap.json'),
fileMapFile: join('df', 'fileMap.json'),
importAliases: {
'@emotion/styled': 'styled',
'@vanilla-extract/css': null,
'styled-components': 'styled',
},
coordinatorPortFile: join('df', 'coordinator.port'),
})
// Verify initial CSS file is written
expect(writeFileSyncSpy).toHaveBeenCalledWith(
join(resolve('df', 'devup-ui'), 'devup-ui.css'),
'',
)
// Verify exit handler was registered and calls coordinator.close()
expect(exitHandlers.length).toBeGreaterThan(0)
exitHandlers[0]!()
expect(closeMock).toHaveBeenCalledTimes(1)
// Verify --inspect-brk env vars are NOT set
expect(process.env.TURBOPACK_DEBUG_JS).toBeUndefined()
expect(process.env.NODE_OPTIONS ?? '').not.toContain('--inspect-brk')
processOnSpy.mockRestore()
})
})
})