Skip to content

Commit 1d20b0d

Browse files
committed
Add tests
1 parent 85a383c commit 1d20b0d

File tree

15 files changed

+1452
-1
lines changed

15 files changed

+1452
-1
lines changed

scripts/install-fixture-deps.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import glob from 'fast-glob'
77
const __dirname = path.dirname(fileURLToPath(import.meta.url))
88

99
const fixtures = glob.sync(
10-
['tests/fixtures/*/package.json', 'tests/fixtures/v4/*/package.json'],
10+
['tests/fixtures/*/package.json', 'tests/fixtures/v4/*/package.json', 'tests/fixtures/monorepo/*/package.json'],
1111
{
1212
cwd: path.resolve(__dirname, '..'),
1313
},

tests/fixtures.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ let fixtures = [
8282
dir: 'custom-pkg-name-v4',
8383
ext: 'html',
8484
},
85+
86+
{
87+
name: 'monorepo / v4',
88+
dir: 'monorepo/package-1',
89+
ext: 'jsx',
90+
},
91+
{
92+
name: 'monorepo / v3',
93+
dir: 'monorepo/package-2',
94+
ext: 'jsx',
95+
},
8596
]
8697

8798
let configs = [
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"tailwindFunctions": ["tw"],
3+
"overrides": [
4+
{
5+
"files": "package-1/**",
6+
"options": {
7+
"tailwindStylesheet": "./package-1/app.css"
8+
}
9+
},
10+
{
11+
"files": "package-2/**",
12+
"options": {}
13+
}
14+
]
15+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
@import 'tailwindcss';
2+
3+
@theme {
4+
--color-tomato: tomato;
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const a = tw`sm:bg-tomato bg-red-500`;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const a = tw`bg-red-500 sm:bg-tomato`;

tests/fixtures/monorepo/package-1/package-lock.json

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"dependencies": {
3+
"tailwindcss": "^4.0.0"
4+
}
5+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const a = tw`sm:bg-tomato bg-red-500`;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
const a = tw`bg-red-500 sm:bg-tomato`;

0 commit comments

Comments
 (0)