Open kazupon opened 1 year ago
Hi dear @kazupon. _generate
is an internal flag an indeed unsupported for test-utils at the moment. What you can do, is to alternatively enable experimental.payloadExtraction
and also enable nitro.prerender.crawlLinks: true
. This generates server that serves static files as well. You can also use X-Powered-By
header to assert if response is static or rendered on demand.
Thank you for your kindful comment, as always! ❤️
I’ve felt that _generate
is for internal.
About experimental.payloadExtraction
and nitro.prerender.crawlLinks: true
, those are good and helpful for me. :)
Thanks!
Describe the feature
If we have a special implementation in the prerender environment, we may want to test it with its built from time to time. case: https://github.com/nuxt-modules/i18n/pull/1733
In
@nuxt/test-utils
setup, we can override thenuxtConfig
option with_generate: true
, which is equivalent tonuxi generate
.However, the server in
@nuxt/test-utils
is not yet ready to run a server for the prerender environment, so the test will stop with the following log output:Additional information
Final checks