Skip to content

Commit e91d6bd

Browse files
Try again I guess
1 parent e220f63 commit e91d6bd

File tree

1 file changed

+66
-81
lines changed

1 file changed

+66
-81
lines changed

integrations/postcss/index.test.ts

Lines changed: 66 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
import path from 'node:path'
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'
2+
import { candidate, css, html, js, json, retryAssertion, test, ts, yaml } from '../utils'
143

154
test(
165
'production build (string)',
@@ -647,62 +636,59 @@ test(
647636
},
648637
)
649638

650-
if (!IS_WINDOWS) {
651-
test(
652-
'rebuild error recovery',
653-
{
654-
fs: {
655-
'package.json': json`
656-
{
657-
"devDependencies": {
658-
"postcss": "^8",
659-
"postcss-cli": "^10",
660-
"tailwindcss": "workspace:^",
661-
"@tailwindcss/postcss": "workspace:^"
662-
}
663-
}
664-
`,
665-
'postcss.config.js': js`
666-
module.exports = {
667-
plugins: {
668-
'@tailwindcss/postcss': {},
669-
},
639+
test(
640+
'rebuild error recovery',
641+
{
642+
fs: {
643+
'package.json': json`
644+
{
645+
"devDependencies": {
646+
"postcss": "^8",
647+
"postcss-cli": "^10",
648+
"tailwindcss": "workspace:^",
649+
"@tailwindcss/postcss": "workspace:^"
670650
}
671-
`,
672-
'src/index.html': html`
651+
}
652+
`,
653+
'postcss.config.js': js`
654+
module.exports = {
655+
plugins: {
656+
'@tailwindcss/postcss': {},
657+
},
658+
}
659+
`,
660+
'src/index.html': html`
673661
<div class="underline"></div>
674662
`,
675-
'src/index.css': css` @import './tailwind.css'; `,
676-
'src/tailwind.css': css`
677-
@reference 'tailwindcss/does-not-exist';
678-
@import 'tailwindcss/utilities';
679-
`,
680-
},
663+
'src/index.css': css` @import './tailwind.css'; `,
664+
'src/tailwind.css': css`
665+
@reference 'tailwindcss/does-not-exist';
666+
@import 'tailwindcss/utilities';
667+
`,
681668
},
682-
async ({ fs, expect, spawn }) => {
683-
let process = await spawn(
684-
'pnpm postcss src/index.css --output dist/out.css --watch --verbose',
685-
)
686-
687-
await process.onStderr((message) =>
688-
message.includes('does-not-exist is not exported from package'),
689-
)
690-
691-
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
692-
693-
await process.onStderr((message) => message.includes('Waiting for file changes...'))
694-
695-
// Fix the CSS file
696-
await fs.write(
697-
'src/tailwind.css',
698-
css`
699-
@reference 'tailwindcss/theme';
700-
@import 'tailwindcss/utilities';
701-
`,
702-
)
703-
await process.onStderr((message) => message.includes('Finished src/index.css'))
704-
705-
expect(await fs.dumpFiles('dist/*.css')).toMatchInlineSnapshot(`
669+
},
670+
async ({ fs, expect, spawn }) => {
671+
let process = await spawn('pnpm postcss src/index.css --output dist/out.css --watch --verbose')
672+
673+
await process.onStderr((message) =>
674+
message.includes('does-not-exist is not exported from package'),
675+
)
676+
677+
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
678+
679+
await process.onStderr((message) => message.includes('Waiting for file changes...'))
680+
681+
// Fix the CSS file
682+
await fs.write(
683+
'src/tailwind.css',
684+
css`
685+
@reference 'tailwindcss/theme';
686+
@import 'tailwindcss/utilities';
687+
`,
688+
)
689+
await process.onStderr((message) => message.includes('Finished src/index.css'))
690+
691+
expect(await fs.dumpFiles('dist/*.css')).toMatchInlineSnapshot(`
706692
"
707693
--- dist/out.css ---
708694
.underline {
@@ -711,20 +697,19 @@ if (!IS_WINDOWS) {
711697
"
712698
`)
713699

714-
// Now break the CSS file again
715-
await fs.write(
716-
'src/tailwind.css',
717-
css`
718-
@reference 'tailwindcss/does-not-exist';
719-
@import 'tailwindcss/utilities';
720-
`,
721-
)
722-
await process.onStderr((message) =>
723-
message.includes('does-not-exist is not exported from package'),
724-
)
725-
await process.onStderr((message) => message.includes('Finished src/index.css'))
726-
727-
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
728-
},
729-
)
730-
}
700+
// Now break the CSS file again
701+
await fs.write(
702+
'src/tailwind.css',
703+
css`
704+
@reference 'tailwindcss/does-not-exist';
705+
@import 'tailwindcss/utilities';
706+
`,
707+
)
708+
await process.onStderr((message) =>
709+
message.includes('does-not-exist is not exported from package'),
710+
)
711+
await process.onStderr((message) => message.includes('Finished src/index.css'))
712+
713+
retryAssertion(async () => expect(await fs.read('dist/out.css')).toEqual(''))
714+
},
715+
)

0 commit comments

Comments
 (0)