Skip to content

Conversation

@exequiel09
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[x] Other... Please describe:

Updates to testing to ensure compatibility to `vitest`

What is the current behavior?

The current behavior is that tests are running perfectly fine on jest. This PR ensures that it runs smoothly on vitest without any errors.

Closes #5018

What is the new behavior?

No new behavior. Just ensures to maintain parity when it runs using vitest

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@netlify
Copy link

netlify bot commented Dec 2, 2025

Deploy Preview for ngrx-io ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit afb1f44
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/69629b625414d7000883f6ee
😎 Deploy Preview https://deploy-preview-5036--ngrx-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 2, 2025

Deploy Preview for ngrx-site-v21 ready!

Name Link
🔨 Latest commit 36ea9a2
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-site-v21/deploys/6946897a8fdd130008a51166
😎 Deploy Preview https://deploy-preview-5036--ngrx-site-v21.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Contributor Author

@exequiel09 exequiel09 left a comment

Choose a reason for hiding this comment

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

Self-comment

@exequiel09 exequiel09 marked this pull request as draft December 2, 2025 05:28
@exequiel09
Copy link
Contributor Author

exequiel09 commented Dec 2, 2025

Only type errors are left which I didn't touch and just appeared when migrated to vitest.

  1. https://github.com/ngrx/platform/actions/runs/19849232805/job/56872554303?pr=5036#step:8:407 (should handle undefined value for the reducer?)
  2. https://github.com/ngrx/platform/actions/runs/19849232805/job/56872554303?pr=5036#step:8:382 (needs to be rewritten??)

Culprit for item 1:
Screenshot 2025-12-02 at 2 59 37 PM

Thinking of how to fix this 🤔

@exequiel09
Copy link
Contributor Author

Would love to ask for some feedback on the PR @markostanimirovic and @brandonroberts especially on the issues that arised upon migrating to vitest. Thank you.

@exequiel09 exequiel09 force-pushed the test/migrate-jest-to-vitest-store branch 7 times, most recently from 2922a93 to 334ecd9 Compare December 7, 2025 16:05
@exequiel09
Copy link
Contributor Author

Hi @timdeschryver would love also your feedback here. Just a couple issues then I think it's good to go. Thank you.

@timdeschryver
Copy link
Member

Hi @timdeschryver would love also your feedback here. Just a couple issues then I think it's good to go. Thank you.

I will take a look at it later this week (probably at the end of it)

@exequiel09 exequiel09 force-pushed the test/migrate-jest-to-vitest-store branch 3 times, most recently from 8853f4b to ea6e106 Compare December 12, 2025 14:34
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

The remaining CI errors are not caused by this PR => they should be resolved in #5044.

From looking at the PR, I think you addressed all of the issues yourself, or is there still something left where you're waiting for input?
The failing type tests can be fixed by updating the timeout to 8_000 within the describe block (this will be passed down to each test case), similar to what's done in #5044.

@exequiel09
Copy link
Contributor Author

The failing type tests can be fixed by updating the timeout to 8_000 within the describe block (this will be passed down to each test case), similar to what's done in #5044.

Addressed this in 35b9962

@exequiel09
Copy link
Contributor Author

exequiel09 commented Dec 15, 2025

The remaining CI errors are not caused by this PR => they should be resolved in #5044.

There are 2 errors that's related to vitest uncaught exceptions.

  1. I mentioned in this comment as problem item 1 (refactor(store): migrate unit tests to Vitest #5036 (comment)) which is reflected as well in this CI run (https://github.com/ngrx/platform/actions/runs/20217503698/job/58033009122?pr=5036#step:8:2150)
Screenshot 2025-12-15 at 9 25 42 AM
  1. I mention in this comment as problem item 2 (refactor(store): migrate unit tests to Vitest #5036 (comment)) which is reflected as well in this CI run (https://github.com/ngrx/platform/actions/runs/20217503698/job/58033009122?pr=5036#step:8:2127)
Screenshot 2025-12-15 at 9 27 12 AM

From looking at the PR, I think you addressed all of the issues yourself, or is there still something left where you're waiting for input?

@timdeschryver I was looking for inputs on how to resolve this. Also, I tried to propose solutions in the comment (#5036 (comment)), that needs to be discussed since the solutions I have thought of might not be up to the team's liking.

@timdeschryver
Copy link
Member

The remaining CI errors are not caused by this PR => they should be resolved in #5044.

There are 2 errors that's related to vitest uncaught exceptions.

  1. I mentioned in this comment as problem item 1 (wip(store): migrate testing suite from jest to vitest #5036 (comment)) which is reflected as well in this CI run (https://github.com/ngrx/platform/actions/runs/20217503698/job/58033009122?pr=5036#step:8:2150)
Screenshot 2025-12-15 at 9 25 42 AM 2. I mention in this comment as problem item 2 ([wip(store): migrate testing suite from jest to vitest #5036 (comment)](https://github.com//pull/5036#issuecomment-3600383044)) which is reflected as well in this CI run (https://github.com/ngrx/platform/actions/runs/20217503698/job/58033009122?pr=5036#step:8:2127) Screenshot 2025-12-15 at 9 27 12 AM > From looking at the PR, I think you addressed all of the issues yourself, or is there still something left where you're waiting for input?

@timdeschryver I was looking for inputs on how to resolve this. Also, I tried to propose solutions in the comment (#5036 (comment)), that needs to be discussed since the solutions I have thought of might not be up to the team's liking.

Oh sorry, I missed those comments while reviewing.
The latest commit should resolve these, the only failing ones are not store related and shouldn't be addressed in this PR.
We can publish the PR and I'll review it once more with a fresh head, I suppose it's good to be merged though.

@exequiel09 exequiel09 changed the title wip(store): migrate testing suite from jest to vitest refactor(store): migrate testing suite from jest to vitest Dec 15, 2025
@exequiel09 exequiel09 marked this pull request as ready for review December 15, 2025 12:28
@exequiel09
Copy link
Contributor Author

exequiel09 commented Dec 15, 2025

We can publish the PR and I'll review it once more with a fresh head, I suppose it's good to be merged though.

Hey @timdeschryver I removed the "draft" status and changed the title to use the type refactor instead of wip.

@timdeschryver timdeschryver changed the title refactor(store): migrate testing suite from jest to vitest refactor(store): migrate unit tests to Vitest Dec 15, 2025
@exequiel09 exequiel09 force-pushed the test/migrate-jest-to-vitest-store branch from 2310a82 to 5a52eb9 Compare December 16, 2025 06:04
@timdeschryver
Copy link
Member

@exequiel09 could you pull the latest main branch into your branch please?
This should resolve the remaining errors.

@exequiel09
Copy link
Contributor Author

I just rebased the PR just moments ago based on the latest commits on the main branch. Did something change again or got merged?

@timdeschryver
Copy link
Member

I just rebased the PR just moments ago based on the latest commits on the main branch. Did something change again or got merged?

Thanks 👍
You can ignore my comment then.

@exequiel09
Copy link
Contributor Author

I just rebased the PR just moments ago based on the latest commits on the main branch. Did something change again or got merged?

Checked. PR is still on top of the commits of main branch.

Screenshot 2025-12-16 at 2 57 42 PM Screenshot 2025-12-16 at 2 58 54 PM

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

Thanks @exequiel09 , great work!

@exequiel09
Copy link
Contributor Author

I see one of the issues exceeded 8000ms. That's why something failed.

https://github.com/ngrx/platform/actions/runs/20258235781/job/58164627027?pr=5036#step:8:1558
Screenshot 2025-12-16 at 3 00 16 PM

@exequiel09 exequiel09 force-pushed the test/migrate-jest-to-vitest-store branch from 36ea9a2 to 141f6a5 Compare December 26, 2025 08:55
@exequiel09 exequiel09 force-pushed the test/migrate-jest-to-vitest-store branch from 141f6a5 to 4bbea6a Compare January 6, 2026 02:38
Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

This looks good to me.
The failing tests are caused by the "affected" tests that are run during the CI.

@markostanimirovic markostanimirovic merged commit d49b21e into ngrx:main Jan 10, 2026
9 of 10 checks passed
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.

@ngrx/store: Migrate Store Unit Tests to Vitest

4 participants