Skip to content

Commit 0bd1959

Browse files
committed
Tests: Address Vitest lint migration feedback
1 parent ecaaf28 commit 0bd1959

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

‎packages/e2e-tests/CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
### Enhancements
66

7-
- Remove the unused Jest peer dependency from the fixture package ([#83505](https://github.com/WordPress/gutenberg/pull/83505)).
7+
- Remove the unused Jest peer dependency from the fixture package ([#83502](https://github.com/WordPress/gutenberg/pull/83502)).
88

99
## 9.21.0 (2026-09-23)
1010

‎test/unit/config/console-test-cases.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ export default function consoleTests() {
178178
cleanup = () => console[ methodName ]( 'Cleanup message.' );
179179
} );
180180

181+
// The unasserted console call must fail the test even after resetting mocks.
182+
// eslint-disable-next-line vitest/expect-expect
181183
test.fails(
182184
'does not let afterEach reset hide an unexpected call',
183185
() => {

‎tools/eslint/config.mjs‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -621,11 +621,28 @@ export default dedupePlugins( [
621621
// Vitest has no no-jasmine-globals equivalent.
622622
'no-restricted-globals': [
623623
'error',
624-
'jasmine',
625-
'spyOn',
626-
'spyOnProperty',
627-
'fail',
628-
'pending',
624+
{
625+
name: 'jasmine',
626+
message: 'Use the vi and expect APIs from Vitest instead.',
627+
},
628+
{
629+
name: 'spyOn',
630+
message: 'Use vi.spyOn() from Vitest instead.',
631+
},
632+
{
633+
name: 'spyOnProperty',
634+
message:
635+
'Use vi.spyOn() from Vitest with a get or set accessor instead.',
636+
},
637+
{
638+
name: 'fail',
639+
message: 'Use expect.fail() from Vitest instead.',
640+
},
641+
{
642+
name: 'pending',
643+
message:
644+
'Use the Vitest test context skip() method instead.',
645+
},
629646
],
630647
},
631648
} ) ),

0 commit comments

Comments
 (0)