I'm currently trying to set up an E2E test suite for a Nuxt SPA app. The tests work, but they currently rely on having the dev server running in the background with npm run dev. What I would like to do, is start the dev server programatically, instead of using the commandline.

I've noticed there's some kind of example in the Nuxt documentation - https://nuxtjs.org/examples/testing/ - But it doesn't work as expected, and the setup instructions also appear to be out of date (it neglects to reference a to of missing dependencies). It starts a server of some kind, but it's not running my app.

I could possibly do something hacky, like call npm run dev in a process, but I'm guessing there's a cleaner way to do it.

Is that right?

0 Answers