MCPcopy
hub / github.com/vitest-dev/vitest / runBrowserTests

Function runBrowserTests

test/browser/specs/to-match-screenshot.test.ts:30–56  ·  view source on GitHub ↗
(
  structure: TestFsStructure,
  config: ViteUserConfig['test'] = {},
)

Source from the content-addressed store, hash-verified

28const browser = 'chromium'
29
30async function runBrowserTests(
31 structure: TestFsStructure,
32 config: ViteUserConfig['test'] = {},
33) {
34 return runInlineTests({
35 ...structure,
36 'vitest.config.js': `
37 import { playwright } from '@vitest/browser-playwright'
38 export default {
39 test: {
40 browser: {
41 enabled: true,
42 screenshotFailures: false,
43 provider: playwright(),
44 headless: true,
45 instances: [{ browser: ${JSON.stringify(browser)} }],
46 },
47 reporters: ['verbose'],
48 ...${JSON.stringify(config)},
49 },
50 }`,
51 }, {
52 $cliOptions: {
53 watch: true,
54 },
55 })
56}
57
58describe.runIf(provider.name === 'playwright')('--watch', () => {
59 test(

Callers 1

Calls 1

runInlineTestsFunction · 0.90

Tested by

no test coverage detected