Skip to content

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Jul 20, 2025

Q A
Bug fix? no
New feature? no
Docs? no
Issues Fix #...
License MIT

Purely internal.

With Vitest, it is "recommended" to not use globals (disabled by default) and instead relying on explicit import.

Even if it means to add more code in the codebase, “Explicit is better than implicit”, and global types definitions can be a mess sometimes.

@carsonbot carsonbot added the Status: Needs Review Needs to be reviewed label Jul 20, 2025
@Kocal Kocal force-pushed the vitest-no-globals branch from 065b057 to a2c040b Compare July 20, 2025 10:44
@Kocal Kocal force-pushed the vitest-no-globals branch from a2c040b to 0bb9d66 Compare July 20, 2025 10:48
*/

import '@testing-library/jest-dom';
import '@testing-library/jest-dom/vitest';
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed, because @testing-library/jest-dom relied on global expect

@Kocal Kocal merged commit 0bb9d66 into symfony:2.x Jul 20, 2025
39 of 44 checks passed
@Kocal Kocal deleted the vitest-no-globals branch July 21, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review Needs to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants