Update integration tests (#8386)

* Add content glob integration tests

* Use tagged version in parcel integration tests

* Upgrade postcss-cli integration tests

* upgrade integration test deps

* Fix CS

* Fix tests

* Update lockfile

* Fix vite test in CI
This commit is contained in:
Jordan Pittman 2022-05-19 16:44:20 -04:00 • committed by GitHub
parent fc25299aa6
commit 30538b363f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
40 changed files with 7704 additions and 36897 deletions

View file

@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
</body>
</html>

View file

@ -1,5 +1,5 @@
module.exports = {
content: ['./src/index.html'],
content: ['./src/index.html', './src/glob/*.{js,html}'],
theme: {
extend: {},
},

View file

@ -140,6 +140,55 @@ describe('watcher', () => {
return runningProcess.stop()
})
test('classes are generated when globbed files change', async () => {
await writeInputFile('glob/index.html', html`<div class="font-bold"></div>`)
let runningProcess = $('node ../../lib/cli.js -i ./src/index.css -o ./dist/main.css -w')
await runningProcess.onStderr(ready)
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.font-bold {
font-weight: 700;
}
`
)
await appendToInputFile('glob/index.html', html`<div class="font-normal"></div>`)
await runningProcess.onStderr(ready)
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.font-bold {
font-weight: 700;
}
.font-normal {
font-weight: 400;
}
`
)
await appendToInputFile('glob/index.html', html`<div class="bg-red-500"></div>`)
await runningProcess.onStderr(ready)
expect(await readOutputFile('main.css')).toIncludeCss(
css`
.bg-red-500 {
--tw-bg-opacity: 1;
background-color: rgb(239 68 68 / var(--tw-bg-opacity));
}
.font-bold {
font-weight: 700;
}
.font-normal {
font-weight: 400;
}
`
)
return runningProcess.stop()
})
test('@layers are replaced and cleaned when the html file changes', async () => {
await writeInputFile('index.html', html`<div class="font-bold"></div>`)
await writeInputFile(