Fix CLI --content option (#5775)

* Add failing test

* Fix CLI `--content` option
This commit is contained in:
Brad Cornes 2021-10-13 19:58:15 +01:00 • committed by GitHub
parent 1a08732382
commit 92df04d0c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -145,6 +145,20 @@ describe('Build command', () => {
)
})
test('--content', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
await $(`${EXECUTABLE} --content ./src/index.html --output ./dist/main.css`)
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.font-bold {
font-weight: 700;
}
`
)
})
test('--postcss (postcss.config.js)', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)