From 9e9c5a259506b3cb9014921b0dfd54f9784cbc08 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 28 Oct 2024 15:34:25 +0100 Subject: [PATCH] add failing test This proves that right now when using a glob, that files that should be git ignored are _not_ git ignored. --- integrations/cli/index.test.ts | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/integrations/cli/index.test.ts b/integrations/cli/index.test.ts index b36ca4c07..cd0c20a5d 100644 --- a/integrations/cli/index.test.ts +++ b/integrations/cli/index.test.ts @@ -256,7 +256,7 @@ describe.each([ ) }) -test( +test.only( 'source(…) and `@source` can be configured to use auto source detection (build + watch mode)', { fs: { @@ -280,9 +280,7 @@ test( /* Run auto-content detection in ../../project-b */ @import 'tailwindcss/utilities' source('../../project-b'); - /* Additive: */ - /* {my-lib-1,my-lib-2}: expand */ - /* *.html: only look for .html */ + /* Explicitly using node_modules in the @source allows git ignored folders */ @source '../node_modules/{my-lib-1,my-lib-2}/src/**/*.html'; /* We typically ignore these extensions, but now include them explicitly */ @@ -290,6 +288,9 @@ test( /* Project C should apply auto source detection */ @source '../../project-c'; + + /* Project D should apply auto source detection rules, such as ignoring node_modules */ + @source '../../project-d/**/*.{html,js}'; `, // Project A is the current folder, but we explicitly configured @@ -362,6 +363,21 @@ test( class="content-['SHOULD-NOT-EXIST-IN-OUTPUT'] content-['project-c/node_modules/my-lib-1/src/index.html']" > `, + + // Project D should apply auto source detection rules, such as ignoring + // node_modules. + 'project-d/node_modules/my-lib-1/src/index.html': html` +
+ `, + + // Project D should look for files with the extensions html and js. + 'project-d/src/index.html': html` +
+ `, }, }, async ({ fs, exec, spawn, root }) => { @@ -392,6 +408,10 @@ test( --tw-content: 'project-c/src/index.html'; content: var(--tw-content); } + .content-\\[\\'project-d\\/src\\/index\\.html\\'\\] { + --tw-content: 'project-d/src/index.html'; + content: var(--tw-content); + } @supports (-moz-orient: inline) { @layer base { *, ::before, ::after, ::backdrop {