Skip to content

Conversation

jdegand
Copy link

@jdegand jdegand commented Sep 1, 2025

I used npx nx g @analogjs/platform:setup-vitest --project demo and npx nx g @analogjs/platform:setup-vitest --project ngrx-toolkit to automatically convert them.

I had to use no-verify since demo has no unit tests. This causes a failure. I did lint and added peer-dependencies to the one package.json. I had TypeScript issues with the one vite.config.mts.

I removed all references to Jest and removed the VSCode extension as well.

I guess you could want to use vitest and playwright together for the demo app. It wasn't really specified, but I figured I might as well give you something to look at first.

There are also peer dependency issues with docusaurus and @types/node.

@rainerhahnekamp
Copy link
Collaborator

rainerhahnekamp commented Sep 1, 2025

Great! Why did you go with the analog version and didn’t use the native Vitest support that comes with Nx out of the box?

Was there a particular reason, e.g. something didn't work?

This makes `rxMutation` a fully autonomous function
which can also be used entirely independently of the
SignalStore.

It also exposes the following additional properties:
- `isSuccess`
- `hasValue`
- `value`
@jdegand
Copy link
Author

jdegand commented Sep 1, 2025

@rainerhahnekamp Recency bias. I have been focused on Analog Vitest Plugin and trying to solve some issues I am having with it. I might close this PR and open another. I really lost no time making this PR as I uncovered some issues along the way.

@jdegand
Copy link
Author

jdegand commented Sep 1, 2025

Using @nx/vite should help with inferred migration. Running npx nx g convert-to-inferred should help convert everything with no issues and then you could remove the .env file.

@jdegand
Copy link
Author

jdegand commented Sep 2, 2025

By not using nx/vite generator, this PR has issues with config files that require manual updates. I am working on a new branch (nx-vitest). I had a few failing tests that I fixed by changing the target to es2016 versus es2022. All tests work in ngrx-toolkit. Do you want me to generate setup in demo-app although there are no unit tests?

@rainerhahnekamp
Copy link
Collaborator

Hey @jdegand 👋, has been a while. It would be great if demo-app would at least support Vitest as well. Were you able to make some progress with your other branch?

@jdegand
Copy link
Author

jdegand commented Sep 29, 2025

@rainerhahnekamp I merged the branch. Adding the Vitest setup to demo-app might cause a check to fail, as I think Vitest returns a failure when there are no tests.

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.

3 participants