Skip to content

Commit ac3c1cd

Browse files
committed
add --no-autoprefixer test including nesting
1 parent 0ca4329 commit ac3c1cd

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

integrations/tailwindcss-cli/tests/cli.test.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,55 @@ describe('Build command', () => {
119119
`)
120120
})
121121

122+
test('--no-autoprefixer (with nesting handling)', async () => {
123+
// This test mainly checks that we configured Lightning CSS correctly such that we can _still_
124+
// use nesting.
125+
await writeInputFile('index.html', html`<div class="select-none"></div>`)
126+
await writeInputFile(
127+
'index.css',
128+
css`
129+
@tailwind utilities;
130+
131+
.foo {
132+
& .bar {
133+
display: flex;
134+
}
135+
}
136+
`
137+
)
138+
139+
await $(`${EXECUTABLE} --input ./src/index.css --output ./dist/main.css`)
140+
let withAutoprefixer = await readOutputFile('main.css')
141+
142+
expect(withAutoprefixer).toIncludeCss(css`
143+
.select-none {
144+
-webkit-user-select: none;
145+
user-select: none;
146+
}
147+
`)
148+
149+
expect(withAutoprefixer).toIncludeCss(css`
150+
.foo .bar {
151+
display: flex;
152+
}
153+
`)
154+
155+
await $(`${EXECUTABLE} --input ./src/index.css --output ./dist/main.css --no-autoprefixer`)
156+
let withoutAutoprefixer = await readOutputFile('main.css')
157+
158+
expect(withoutAutoprefixer).toIncludeCss(css`
159+
.select-none {
160+
user-select: none;
161+
}
162+
`)
163+
164+
expect(withoutAutoprefixer).toIncludeCss(css`
165+
.foo .bar {
166+
display: flex;
167+
}
168+
`)
169+
})
170+
122171
test('--config (non-existing config file)', async () => {
123172
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
124173

0 commit comments

Comments
 (0)