Open tobiasdiez opened 3 months ago
@danielroe friendly ping. Is there anything a can improve in this PR?
I love this and would like to get this or something like it merged, but just want to make sure we do it in the best way. Will review soon.
@tobiasdiez Is the only use-case here avoiding restarting/rebuilding the server when running tests? (ie. if we can solve that issue, do you still think this is a needed feature?)
My use cases are:
nuxi dev
to start a dev server, make some changes, and then want to verify that your changes are not breaking anything, it would be nice if the already running dev server is used as the endpoint for the tests instead of spinning up a new dev server. Personally, the first use case is actually more important for me.
This PR seems ideal for my use-case as well. We build for the nitro preset cloudflare-module
which doesn't seem to be compatible out of the box with @nuxt/test-utils
, meaning I have to override the preset when running tests to node-server
.
Being able to do a build separately, running the build via wrangler
, and then pointing the tests to the URL speeds things up exponentially.
The only issue I encounter is that it cannot seem to fetch the manifest:
@danielroe I'd be open to other ways of speeding up/reusing a build, but this PR seems promising other than the manifest error above
I think we'll go ahead with this approach. Would you be able to add a test? 🙏
Allow to pass the url of an already running server to
setup
and use this as the target instead of building and running a new server. This has two use cases:Usage:
(or of course just using a hard-coded url)