Skip to content

Commit 5a9d1f4

Browse files
Fix test that relies on mtimes (#17529)
Fixes a timing issue added to a new unit test on `main`. Going to wait for the `CI / Linux` unit tests to pass 3 times before merging this.
1 parent 4200a1e commit 5a9d1f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/@tailwindcss-postcss/src/index.test.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ describe('concurrent builds', () => {
378378
})
379379
afterEach(() => rm(dir, { recursive: true, force: true }))
380380

381-
test('the current working directory is used by default', async () => {
381+
test('does experience a race-condition when calling the plugin two times for the same change', async () => {
382382
const spy = vi.spyOn(process, 'cwd')
383383
spy.mockReturnValue(dir)
384384

@@ -401,6 +401,8 @@ describe('concurrent builds', () => {
401401

402402
expect(result).toContain('.underline')
403403

404+
// Ensure that the mtime is updated
405+
await new Promise((resolve) => setTimeout(resolve, 100))
404406
await writeFile(
405407
path.join(dir, 'dependency.css'),
406408
css`

0 commit comments

Comments
 (0)