Skip to content

Browser mode showing blank page #5308

@guansss

Description

@guansss

Describe the bug

When using browser mode, the browser window pops up with a blank page regardless of the test status.

image

I guess it's because the iframe's src assignment was removed in this PR?

Reproduction

It's just a basic setup so I'm just pasting the files here:

{
  "name": "vitest-ui-bug",
  "version": "1.0.0",
  "type": "module",
  "scripts": {
    "test": "vitest"
  },
  "devDependencies": {
    "vitest": "^1.3.1"
  }
}
import { test, expect } from 'vitest';

test('foo', () => {
  expect(window.innerWidth).toBeGreaterThan(0);
});
npx vitest --browser=chrome

The test passed normally.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400 @ 2.60GHz
    Memory: 3.48 GB / 15.80 GB
  Binaries:
    Node: 18.19.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\scoop\apps\yarn\current\bin\yarn.CMD
    npm: 10.2.5 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (121.0.2277.128)
    Internet Explorer: 11.0.19041.3636
  npmPackages:
    vitest: ^1.3.1 => 1.3.1

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions