[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.

docs: remove defineCommand reference

Closes #6148

Vladimir Sheremet (Jul 16, 2024, 12:47 PM +0200) 32c0d99b a852b161

+7 -3
+7 -3
docs/guide/browser/commands.md
··· 132 132 - `context` refers to the unique [BrowserContext](https://playwright.dev/docs/api/class-browsercontext). 133 133 134 134 ```ts 135 - import { defineCommand } from '@vitest/browser' 135 + import { BrowserCommand } from 'vitest/node' 136 136 137 - export const myCommand = defineCommand(async (ctx, arg1, arg2) => { 137 + export const myCommand: BrowserCommand<[string, number]> = async ( 138 + ctx, 139 + arg1: string, 140 + arg2: number 141 + ) => { 138 142 if (ctx.provider.name === 'playwright') { 139 143 const element = await ctx.iframe.findByRole('alert') 140 144 const screenshot = await element.screenshot() 141 145 // do something with the screenshot 142 146 return difference 143 147 } 144 - }) 148 + } 145 149 ``` 146 150 147 151 ::: tip