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:
parent
86e389001b
commit
e3c5c11474
2 changed files with 73 additions and 1858 deletions
|
|
@ -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
1924
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue