Skip to content

Commit caa7d73

Browse files
authored
fix(browser): fix invalid project token for artifacts assets (#9321)
1 parent c8f8f98 commit caa7d73

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/vitest/rollup.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const plugins = [
109109
define: {
110110
// __VITEST_GENERATE_UI_TOKEN__ is set as a global to catch accidental leaking,
111111
// in the release version the "if" with this condition should not be present
112+
// To test strict token locally, build by e.g. `VITEST_GENERATE_UI_TOKEN=true pnpm build`
112113
__VITEST_GENERATE_UI_TOKEN__: process.env.VITEST_GENERATE_UI_TOKEN === 'true' ? 'true' : 'false',
113114
...(process.env.VITE_TEST_WATCHER_DEBUG === 'false'
114115
? {

packages/vitest/src/node/project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ export class TestProject {
544544
},
545545
server.config,
546546
)
547+
this._config.api.token = this.vitest.config.api.token
547548
this._setHash()
548549
for (const _providedKey in this.config.provide) {
549550
const providedKey = _providedKey as keyof ProvidedContext

0 commit comments

Comments
 (0)