Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e43458e

Browse files
authored
fix(expect): preserve currentTestName in extended matchers (#9106)
1 parent deee83e commit e43458e

File tree

1 file changed

+2
-0
lines changed
  • packages/expect/src
    • jest-extend.ts

1 file changed

+2
-0
lines changed

packages/expect/src/jest-extend.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function getMatcherState(
3535
subsetEquality,
3636
}
3737
let task: Test | undefined = util.flag(assertion, 'vitest-test')
38+
const currentTestName = task?.fullTestName ?? ''
3839

3940
if (task?.type !== 'test') {
4041
task = undefined
@@ -43,6 +44,7 @@ function getMatcherState(
4344
const matcherState: MatcherState = {
4445
...getState(expect),
4546
task,
47+
currentTestName,
4648
customTesters: getCustomEqualityTesters(),
4749
isNot,
4850
utils: jestUtils,

0 commit comments

Comments
(0)