|
1 | 1 | import dedent from 'dedent'
|
2 | 2 | import os from 'node:os'
|
3 | 3 | import path from 'node:path'
|
4 |
| -import { describe, expect } from 'vitest' |
| 4 | +import { describe } from 'vitest' |
5 | 5 | import { candidate, css, html, js, json, test, ts, yaml } from '../utils'
|
6 | 6 |
|
7 | 7 | const STANDALONE_BINARY = (() => {
|
@@ -156,9 +156,10 @@ describe.each([
|
156 | 156 | },
|
157 | 157 | },
|
158 | 158 | async ({ root, fs, spawn }) => {
|
159 |
| - await spawn(`${command} --input src/index.css --output dist/out.css --watch`, { |
| 159 | + let process = await spawn(`${command} --input src/index.css --output dist/out.css --watch`, { |
160 | 160 | cwd: path.join(root, 'project-a'),
|
161 | 161 | })
|
| 162 | + await process.onStderr((m) => m.includes('Done in')) |
162 | 163 |
|
163 | 164 | await fs.expectFileToContain('project-a/dist/out.css', [
|
164 | 165 | candidate`underline`,
|
@@ -491,7 +492,7 @@ test(
|
491 | 492 | 'pages/nested/foo.jsx': 'content-["pages/nested/foo.jsx"] content-["BAD"]',
|
492 | 493 | },
|
493 | 494 | },
|
494 |
| - async ({ fs, exec }) => { |
| 495 | + async ({ fs, exec, expect }) => { |
495 | 496 | await exec('pnpm tailwindcss --input index.css --output dist/out.css')
|
496 | 497 |
|
497 | 498 | expect(await fs.dumpFiles('./dist/*.css')).toMatchInlineSnapshot(`
|
@@ -722,7 +723,7 @@ test(
|
722 | 723 | ></div>`,
|
723 | 724 | },
|
724 | 725 | },
|
725 |
| - async ({ fs, exec, spawn, root }) => { |
| 726 | + async ({ fs, exec, spawn, root, expect }) => { |
726 | 727 | await exec('pnpm tailwindcss --input src/index.css --output dist/out.css', {
|
727 | 728 | cwd: path.join(root, 'project-a'),
|
728 | 729 | })
|
@@ -790,9 +791,13 @@ test(
|
790 | 791 | `)
|
791 | 792 |
|
792 | 793 | // Watch mode tests
|
793 |
| - await spawn('pnpm tailwindcss --input src/index.css --output dist/out.css --watch', { |
794 |
| - cwd: path.join(root, 'project-a'), |
795 |
| - }) |
| 794 | + let process = await spawn( |
| 795 | + 'pnpm tailwindcss --input src/index.css --output dist/out.css --watch', |
| 796 | + { |
| 797 | + cwd: path.join(root, 'project-a'), |
| 798 | + }, |
| 799 | + ) |
| 800 | + await process.onStderr((m) => m.includes('Done in')) |
796 | 801 |
|
797 | 802 | // Changes to project-a should not be included in the output, we changed the
|
798 | 803 | // base folder to project-b.
|
@@ -962,7 +967,7 @@ test(
|
962 | 967 | 'pages/nested/foo.jsx': 'content-["pages/nested/foo.jsx"] content-["BAD"]',
|
963 | 968 | },
|
964 | 969 | },
|
965 |
| - async ({ fs, exec }) => { |
| 970 | + async ({ fs, exec, expect }) => { |
966 | 971 | await exec('pnpm tailwindcss --input index.css --output dist/out.css')
|
967 | 972 |
|
968 | 973 | expect(await fs.dumpFiles('./dist/*.css')).toMatchInlineSnapshot(`
|
|
0 commit comments