Skip to content

Commit 1022371

Browse files
committed
add integration test
1 parent 0791af2 commit 1022371

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

integrations/cli/index.test.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,3 +1197,65 @@ test(
11971197
`)
11981198
},
11991199
)
1200+
1201+
test(
1202+
'@theme reference should never emit values',
1203+
{
1204+
fs: {
1205+
'package.json': json`
1206+
{
1207+
"dependencies": {
1208+
"tailwindcss": "workspace:^",
1209+
"@tailwindcss/cli": "workspace:^"
1210+
}
1211+
}
1212+
`,
1213+
'src/index.css': css`
1214+
@reference "tailwindcss";
1215+
1216+
.keep-me {
1217+
color: red;
1218+
}
1219+
`,
1220+
},
1221+
},
1222+
async ({ fs, spawn, expect }) => {
1223+
let process = await spawn(
1224+
`pnpm tailwindcss --input src/index.css --output dist/out.css --watch`,
1225+
)
1226+
await process.onStderr((m) => m.includes('Done in'))
1227+
1228+
expect(await fs.dumpFiles('./dist/*.css')).toMatchInlineSnapshot(`
1229+
"
1230+
--- ./dist/out.css ---
1231+
.keep-me {
1232+
color: red;
1233+
}
1234+
"
1235+
`)
1236+
1237+
await fs.write(
1238+
'./src/index.css',
1239+
css`
1240+
@reference "tailwindcss";
1241+
1242+
/* Not a reference! */
1243+
@theme {
1244+
--color-pink: pink;
1245+
}
1246+
1247+
.keep-me {
1248+
color: red;
1249+
}
1250+
`,
1251+
)
1252+
expect(await fs.dumpFiles('./dist/*.css')).toMatchInlineSnapshot(`
1253+
"
1254+
--- ./dist/out.css ---
1255+
.keep-me {
1256+
color: red;
1257+
}
1258+
"
1259+
`)
1260+
},
1261+
)

0 commit comments

Comments
 (0)