How to run Next.js and Jest concurrently, with an instance of Next.js already running? #87116
Unanswered
codigoisaac
asked this question in
Help
Replies: 1 comment 1 reply
-
|
Maybe you need to set this to false for testing:
module.exports = {
experimental: {
lockDistDir: false
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I have this script in my Next.js project, where I start a Next.js server (because the tests need it) and run Jest tests using concurrently:
It was working fine until i updated Next.js to version 16. In previous versions, it was possible to have multiple Next.js instances running on the same project, but in Next.js 16 it isn't anymore.
Because of this, when I have my development server running and run this test command above, Next.js exits with code 1 because it can't start a second instance, and because of the
--kill-othersflag,concurrentlywill kill the Jest process and the tests will not finish.If I don't use the
--kill-othersflag, and Next.js successfully starts because there is no other instance running, it will stay running forever.I would need one of this solutions, or others:
However, I don't know how to do any of those solutions, or if there would be a better one.
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions