Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(astro): Switch to explicit vitest imports #13093

Merged
merged 1 commit into from
Jul 30, 2024
Merged

Conversation

AbhiPrasad
Copy link
Member

As per https://vitest.dev/config/#globals

By default, vitest does not provide global APIs for explicitness

I think we should follow vitest defaults here and explicitly import in the APIs that we need. This refactors our Astro SDK tests to do so.

ref #11084

I also went ahead and fixed up some TS errors in some tests.

This change also removes environment: 'jsdom' from the vite config as it seems nothing needs this for astro. This should means that our tests are not polluted with jsdom globals, and that future writers have to explicitly opt-in to the behaviour.

@AbhiPrasad AbhiPrasad requested review from Lms24 and a team July 29, 2024 19:21
@AbhiPrasad AbhiPrasad self-assigned this Jul 29, 2024
@AbhiPrasad AbhiPrasad requested review from mydea and removed request for a team July 29, 2024 19:21
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Thanks!

@AbhiPrasad AbhiPrasad merged commit b7e62c4 into develop Jul 30, 2024
96 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-vitest-astro branch July 30, 2024 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants