From 7246a1b3108366cbeb2c07dff81ce72cac402ed0 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Fri, 25 Oct 2024 12:52:08 +0200 Subject: [PATCH] update test --- integrations/cli/index.test.ts | 60 +++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 4 deletions(-) diff --git a/integrations/cli/index.test.ts b/integrations/cli/index.test.ts index f17ca0e6a..5b27558d1 100644 --- a/integrations/cli/index.test.ts +++ b/integrations/cli/index.test.ts @@ -285,18 +285,33 @@ describe.only('@source', () => { /* {my-lib-1,my-lib-2}: expand */ /* *.html: only look for .html */ @source '../node_modules/{my-lib-1,my-lib-2}/src/**/*.html'; - @source './logo.{jpg,png}'; /* Don't worry about it */ + + /* We typically ignore these extensions, but now include them explicitly */ + @source './logo.{jpg,png}'; + + /* Project C should apply auto source detection */ + @source '../../project-c'; `, + + // Project A is the current folder, but we explicitly configured + // `source(project-b)`, therefore project-a should not be included in + // the output. 'project-a/src/index.html': html`
`, + + // Project A explicitly includes an extension we usually ignore, + // therefore it should be included in the output. 'project-a/src/logo.jpg': html`
`, + + // Project A explicitly includes node_modules/{my-lib-1,my-lib-2}, + // therefore these files should be included in the output. 'project-a/node_modules/my-lib-1/src/index.html': html`
{ class="content-['project-a/node_modules/my-lib-2/src/index.html']" >
`, + + // Project B is the configured `source(…)`, therefore auto source + // detection should include known extensions and folders in the output. 'project-b/src/index.html': html`
`, + + // Project B is the configured `source(…)`, therefore auto source + // detection should apply and node_modules should not be included in the + // output. 'project-b/node_modules/my-lib-3/src/index.html': html`
`, + + // Project C should apply auto source detection, therefore known + // extensions and folders should be included in the output. + 'project-c/src/index.html': html` +
+ `, + + // Project C should apply auto source detection, therefore known ignored + // extensions should not be included in the output. + 'project-c/src/logo.jpg': html` +
+ `, + + // Project C should apply auto source detection, therefore node_modules + // should not be included in the output. + 'project-c/node_modules/my-lib-1/src/index.html': html` +
+ `, }, }, async ({ fs, exec, root }) => { - await exec('pnpm tailwindcss --input src/index.css --output dist/out.css', { - cwd: path.join(root, 'project-a'), - }) + console.log( + await exec('pnpm tailwindcss --input src/index.css --output dist/out.css', { + cwd: path.join(root, 'project-a'), + }), + ) expect(await fs.dumpFiles('./project-a/dist/*.css')).toMatchInlineSnapshot(` " @@ -344,6 +392,10 @@ describe.only('@source', () => { --tw-content: 'project-b/src/index.html'; content: var(--tw-content); } + .content-\\[\\'project-c\\/src\\/index\\.html\\'\\] { + --tw-content: 'project-c/src/index.html'; + content: var(--tw-content); + } } @supports (-moz-orient: inline) { @layer base {