···44import { BrowserCommand } from 'vitest/node'
5566const forceCrash: BrowserCommand<[]> = async (context) => {
77- const browser = context.context.browser().browserType().name()
88- if (browser === 'chromium') {
99- await context.page.goto('chrome://crash')
1010- }
77+ if (context.provider.name === 'playwright') {
88+ const browser = context.context.browser().browserType().name()
99+ if (browser === 'chromium') {
1010+ await context.page.goto('chrome://crash')
1111+ }
11121212- if (browser === 'firefox') {
1313- await context.page.goto('about:crashcontent')
1414- }
1313+ if (browser === 'firefox') {
1414+ await context.page.goto('about:crashcontent')
1515+ }
15161616- throw new Error(`Browser crash not supported for ${browser}`)
1717+ throw new Error(`Browser crash not supported for ${browser}`)
1818+ }
1919+ if (context.provider.name === 'webdriverio') {
2020+ // @ts-expect-error not typed
2121+ const browser = context.browser as any
2222+ const name = context.project.config.browser.name
2323+ if (name === 'chrome') {
2424+ await browser.url('chrome://crash')
2525+ }
2626+ if (name === 'firefox') {
2727+ await browser.url('about:crashcontent')
2828+ }
2929+ throw new Error(`Browser crash not supported for ${name}`)
3030+ }
1731}
18321933export default defineConfig({
-4
test/core/test/__snapshots__/mocked.test.ts.snap
···7474exports[`mocked function which fails on toReturnWith > zero call 1`] = `
7575"expected "spy" to return with: 2 at least once
76767777-Received:
7878-7979-8080-8177Number of calls: 0
8278"
8379`;