Skip to content

Commit a53c9e5

Browse files
committed
reduce reproduction code
1 parent 2285a53 commit a53c9e5

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

packages/codegen/src/runner.test.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,9 @@ async function sleep(ms: number): Promise<void> {
1111
return new Promise((resolve) => setTimeout(resolve, ms));
1212
}
1313

14-
async function waitForWatcherReady(): Promise<void> {
15-
// Workaround for https://github.com/paulmillr/chokidar/issues/1443
16-
if (platform === 'darwin') {
17-
await sleep(100);
18-
}
19-
}
2014
async function waitForWatcherEmitAndReportDiagnostics(): Promise<void> {
2115
// In watch mode, emits and diagnostic reports are batched with a 250ms delay. Therefore, a wait longer than 250ms is required.
22-
await sleep(500);
16+
await sleep(2000);
2317
}
2418

2519
describe('runCMKInWatchMode', () => {
@@ -35,7 +29,11 @@ describe('runCMKInWatchMode', () => {
3529

3630
const loggerSpy = createLoggerSpy();
3731
const watcher = await runCMKInWatchMode(fakeParsedArgs({ project: iff.rootDir }), loggerSpy);
38-
await waitForWatcherReady();
32+
33+
// Workaround for https://github.com/paulmillr/chokidar/issues/1443
34+
if (platform === 'darwin') {
35+
await sleep(100);
36+
}
3937

4038
// Error when changing a file
4139
console.log('update a.module.css');

0 commit comments

Comments
 (0)