Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/api/test.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,15 @@ import { test as baseTest, describe, expect } from 'vitest'

const test = baseTest
.extend('dependency', 'default')
.extend('dependant', ({ dependency }) => dependency)
.extend('dependent', ({ dependency }) => dependency)

describe('use scoped values', () => {
test.override({ dependency: 'new' })

test('uses scoped value', ({ dependant }) => {
// `dependant` uses the new overridden value that is scoped
test('uses scoped value', ({ dependent }) => {
// `dependent` uses the new overridden value that is scoped
// to all tests in this suite
expect(dependant).toEqual({ dependency: 'new' })
expect(dependent).toEqual({ dependency: 'new' })
Comment on lines 300 to +304
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this example, dependency is a string fixture ('default' / overridden to 'new') and dependent returns dependency directly, so dependent will be 'new' (a string). The current assertion expects an object { dependency: 'new' }, which doesn't match the shown fixtures. Either update the assertion to compare against 'new', or change the dependent fixture to return an object (and adjust the override accordingly).

Copilot uses AI. Check for mistakes.
})
})
```
Expand Down
Loading