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(browser): Switch from jest to vitest #13092

Merged
merged 1 commit into from
Aug 1, 2024
Merged

Conversation

AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Jul 29, 2024

Before: Time: 10.517 s

After: Duration 3.65s (transform 2.76s, setup 7ms, collect 15.44s, tests 1.36s, environment 4.96s, prepare 3.63s)

We also change the folder structure of the browser unit tests, because we've removed the in-package integration tests (see #12967)

ref #11084

This change also removes environment: 'jsdom' from the central config in favour of explicitly adding jsdom environment via the @vitest-environment pragma to the specific test file that needs it. 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 a review from a team July 29, 2024 19:11
@AbhiPrasad AbhiPrasad self-assigned this Jul 29, 2024
@AbhiPrasad AbhiPrasad requested review from lforst and nicohrubec and removed request for a team July 29, 2024 19:11
@@ -226,29 +236,6 @@ describe('browserTracingIntegration', () => {
});
});

it("trims pageload transactions to the max duration of the transaction's children", async () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

I deleted this test because switching to the vitest timers kept it failing - but does this behaviour even apply anymore with the new changes?

Maybe @mydea you know what is happening here?

Copy link
Contributor

@nicohrubec nicohrubec left a comment

Choose a reason for hiding this comment

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

lgtm! (if the unit test is no longer relevant)

@AbhiPrasad AbhiPrasad merged commit 21b0dae into develop Aug 1, 2024
122 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-vitest-browser branch August 1, 2024 15:37
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