Skip to content

Commit 32c0d99

Browse files
committed
docs: remove defineCommand reference
Closes #6148
1 parent a852b16 commit 32c0d99

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

docs/guide/browser/commands.md

+7-3
Original file line numberDiff line numberDiff line change
@@ -132,16 +132,20 @@ Vitest exposes several `playwright` specific properties on the command context.
132132
- `context` refers to the unique [BrowserContext](https://playwright.dev/docs/api/class-browsercontext).
133133

134134
```ts
135-
import { defineCommand } from '@vitest/browser'
135+
import { BrowserCommand } from 'vitest/node'
136136

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+
) => {
138142
if (ctx.provider.name === 'playwright') {
139143
const element = await ctx.iframe.findByRole('alert')
140144
const screenshot = await element.screenshot()
141145
// do something with the screenshot
142146
return difference
143147
}
144-
})
148+
}
145149
```
146150

147151
::: tip

0 commit comments

Comments
 (0)