[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix(browser): encode iframeId in tester iframe URL (fix #10520) (#10521)

Co-authored-by: Pduhard <Pduhard@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

authored by

Pduhard
Pduhard
Claude Opus 4.8
and committed by
GitHub
(Jun 8, 2026, 7:23 AM +0200) c8bf19f6 f26552c6

+36 -1
+20
test/browser/specs/file-path-encoding.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + import { instances, provider, runBrowserTests } from './utils' 3 + 4 + test('runs tests from files whose path contains a plus sign', async () => { 5 + const { stderr, stdout, exitCode } = await runBrowserTests({ 6 + root: './fixtures/file-path-encoding', 7 + reporters: ['verbose'], 8 + browser: { 9 + provider, 10 + instances, 11 + }, 12 + }) 13 + 14 + expect(stderr).toBe('') 15 + expect(exitCode).toBe(0) 16 + 17 + instances.forEach(({ browser }) => { 18 + expect(stdout).toReportPassedTest('a+b.test.ts', browser) 19 + }) 20 + })
+1 -1
packages/browser/src/client/orchestrator.ts
··· 353 353 354 354 private createTestIframe(iframeId: string) { 355 355 const iframe = document.createElement('iframe') 356 - const src = `/?sessionId=${getBrowserState().sessionId}&iframeId=${iframeId}` 356 + const src = `/?sessionId=${getBrowserState().sessionId}&iframeId=${encodeURIComponent(iframeId)}` 357 357 const config = getConfig() 358 358 359 359 iframe.setAttribute('loading', 'eager')
+5
test/browser/fixtures/file-path-encoding/a+b.test.ts
··· 1 + import { expect, test } from 'vitest' 2 + 3 + test('runs a test from a file whose path contains a plus sign', () => { 4 + expect(true).toBe(true) 5 + })
+10
test/browser/fixtures/file-path-encoding/vitest.config.ts
··· 1 + import { defineConfig } from 'vitest/config' 2 + 3 + export default defineConfig({ 4 + test: { 5 + browser: { 6 + enabled: true, 7 + headless: true, 8 + }, 9 + }, 10 + })