Skip to content

Commit e220f63

Browse files
Update test to retry assertion on empty file
1 parent d2daf59 commit e220f63

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

integrations/postcss/index.test.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
import path from 'node:path'
2-
import { candidate, css, html, IS_WINDOWS, js, json, test, ts, yaml } from '../utils'
2+
import {
3+
candidate,
4+
css,
5+
html,
6+
IS_WINDOWS,
7+
js,
8+
json,
9+
retryAssertion,
10+
test,
11+
ts,
12+
yaml,
13+
} from '../utils'
314

415
test(
516
'production build (string)',
@@ -677,12 +688,7 @@ if (!IS_WINDOWS) {
677688
message.includes('does-not-exist is not exported from package'),
678689
)
679690

680-
expect(await fs.dumpFiles('dist/*.css')).toMatchInlineSnapshot(`
681-
"
682-
--- dist/out.css ---
683-
<EMPTY>
684-
"
685-
`)
691+
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
686692

687693
await process.onStderr((message) => message.includes('Waiting for file changes...'))
688694

@@ -718,12 +724,7 @@ if (!IS_WINDOWS) {
718724
)
719725
await process.onStderr((message) => message.includes('Finished src/index.css'))
720726

721-
expect(await fs.dumpFiles('dist/*.css')).toMatchInlineSnapshot(`
722-
"
723-
--- dist/out.css ---
724-
<EMPTY>
725-
"
726-
`)
727+
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
727728
},
728729
)
729730
}

0 commit comments

Comments
 (0)