-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
fix(nextjs): schema type for unitTestRunner for library #26824
fix(nextjs): schema type for unitTestRunner for library #26824
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 68bd481. As they complete they will appear below. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this CI Pipeline Execution ✅ Successfully ran 4 targets
Sent with 💌 from NxCloud. |
I did a little typo in the issue description. I tried to run generate command with vitest like:
```
nx g @nx/next:library shared --dir=modules/shared --style none --dry-run --projectNameAndRootFormat as-provided --component false --unitTestRunner vitest
```
And it worked for me. The docs also say that you can use vitest value as a unitTestRunner for this next generator
From: Nicholas Cunningham ***@***.***>
Date: Thursday, 4 July 2024 at 19:04
To: nrwl/nx ***@***.***>
Cc: Feliche-Demian Netliukh ***@***.***>, Author ***@***.***>
Subject: Re: [nrwl/nx] fix(next): schema type for unitTestRunner (PR #26824)
Hi, this alone would not be enough to enable vitest as your unitTestRunner.
If you want to put together an updated PR here is what you would need to do:
Currently, we are only generating jest so you would need to create the vitest config and also install the necessary packages.
It is done like this in our react generator: https://github.com/nrwl/nx/blob/master/packages/react/src/generators/application/application.ts#L224
So you would need to change: https://github.com/nrwl/nx/blob/master/packages/next/src/generators/application/application.ts#L68 to to check for which unitTestRunner was passed in and generate the files accordingly.
—
Reply to this email directly, view it on GitHub<#26824 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AMHTY7HVGAAJ7TEQ5MS64XLZKWFDTAVCNFSM6AAAAABKLYMELOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMBZGQYTONBTGI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
9703dfe
to
68bd481
Compare
## Current Behavior The [docs](https://nx.dev/nx-api/next/generators/library#unittestrunner) say that you can use vitest as a unitTestRunner option. It also worked when I tested with the following command: ```sh nx g @nx/next:library shared --dir=modules/shared --style none --dry-run --projectNameAndRootFormat as-provided --component false --unitTestRunner vitest ``` But types say otherwise:  ## Expected Behavior Types will allow 'vitest' option for a unitTestRunner ## Related Issue(s) none Co-authored-by: Emily Xiong <xiongemi@gmail.com> (cherry picked from commit 73f12a3)
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
The docs say that you can use vitest as a unitTestRunner option. It also worked when I tested with the following command:
nx g @nx/next:library shared --dir=modules/shared --style none --dry-run --projectNameAndRootFormat as-provided --component false --unitTestRunner vitest
But types say otherwise:

Expected Behavior
Types will allow 'vitest' option for a unitTestRunner
Related Issue(s)
none