Skip to content

Commit e3c5c11

Browse files
authored
Update Vite; fix test regex (#12994)
Vite is generating files like "index--T9oO-MP.css", which required relaxing the regex used in tests.
1 parent 86e3890 commit e3c5c11

File tree

2 files changed

+73
-1858
lines changed

2 files changed

+73
-1858
lines changed

integrations/vite/tests/integration.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let { readOutputFile, appendToInputFile, writeInputFile, removeFile } = require(
99
})
1010

1111
let PORT = 1337
12+
let OUTPUT_REGEX = /index[.-][\w-]+\.css$/
1213

1314
async function fetchCSS() {
1415
let response = await fetch(`http://localhost:${PORT}/index.css`, {
@@ -33,7 +34,7 @@ describe('static build', () => {
3334
env: { NODE_ENV: 'production', NO_COLOR: '1' },
3435
})
3536

36-
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
37+
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
3738
css`
3839
.font-bold {
3940
font-weight: 700;
@@ -74,7 +75,7 @@ describe('static build', () => {
7475
env: { NODE_ENV: 'production', NO_COLOR: '1' },
7576
})
7677

77-
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
78+
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
7879
css`
7980
.z-primary {
8081
z-index: 0;
@@ -117,7 +118,7 @@ describe('static build', () => {
117118
env: { NODE_ENV: 'production', NO_COLOR: '1' },
118119
})
119120

120-
expect(await readOutputFile(/index.\w+\.css$/)).toIncludeCss(
121+
expect(await readOutputFile(OUTPUT_REGEX)).toIncludeCss(
121122
css`
122123
.z-primary {
123124
z-index: 0;

0 commit comments

Comments
 (0)