Update Vite; fix test regex (#12994)

Vite is generating files like "index--T9oO-MP.css", which required relaxing the regex used in tests.
This commit is contained in:
Kris Braun 2024-02-21 15:09:19 -05:00 • committed by GitHub
parent 86e389001b
commit e3c5c11474
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 73 additions and 1858 deletions

View file

@ -9,6 +9,7 @@ let { readOutputFile, appendToInputFile, writeInputFile, removeFile } = require(
})
let PORT = 1337
let OUTPUT_REGEX = /index[.-][\w-]+\.css$/
async function fetchCSS() {
let response = await fetch(`http://localhost:${PORT}/index.css`, {
@ -33,7 +34,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production', NO_COLOR: '1' },
})
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
css`
.font-bold {
font-weight: 700;
@ -74,7 +75,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production', NO_COLOR: '1' },
})
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
css`
.z-primary {
z-index: 0;
@ -117,7 +118,7 @@ describe('static build', () => {
env: { NODE_ENV: 'production', NO_COLOR: '1' },
})
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
css`
.z-primary {
z-index: 0;

1924
package-lock.json generated

File diff suppressed because it is too large Load diff