Skip to content

Commit 3f8599e

Browse files
committedJan 15, 2025··
fix(vitest-environment): respect any configured buildId
1 parent 155c3e4 commit 3f8599e

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed
 

‎src/environments/vitest/index.ts

+7-14
Original file line numberDiff line numberDiff line change
@@ -123,35 +123,28 @@ export default <Environment>{
123123
)
124124
const manifestBaseRoutePath = joinURL('/_', manifestOutputPath)
125125

126+
// @ts-expect-error untyped __NUXT__ variable
127+
const buildId = win.__NUXT__.config.app.buildId || 'test'
128+
126129
h3App.use(
127130
`${manifestBaseRoutePath}/latest.json`,
128131
defineEventHandler(() => ({
129-
id: 'test',
130-
timestamp,
131-
})),
132-
)
133-
h3App.use(
134-
`${manifestBaseRoutePath}/meta/test.json`,
135-
defineEventHandler(() => ({
136-
id: 'test',
132+
id: buildId,
137133
timestamp,
138-
matcher,
139-
prerendered: [],
140134
})),
141135
)
142136
h3App.use(
143-
`${manifestBaseRoutePath}/meta/dev.json`,
137+
`${manifestBaseRoutePath}/meta/${buildId}.json`,
144138
defineEventHandler(() => ({
145-
id: 'test',
139+
id: buildId,
146140
timestamp,
147141
matcher,
148142
prerendered: [],
149143
})),
150144
)
151145

152146
registry.add(`${manifestOutputPath}/latest.json`)
153-
registry.add(`${manifestOutputPath}/meta/test.json`)
154-
registry.add(`${manifestOutputPath}/meta/dev.json`)
147+
registry.add(`${manifestBaseRoutePath}/meta/${buildId}.json`)
155148

156149
return {
157150
// called after all tests with this env have been run

0 commit comments

Comments
 (0)
Please sign in to comment.