Skip to content
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

Possible Cypress related issue with package.json scripts setup #175

Closed
cfjedimaster opened this issue Oct 12, 2022 · 1 comment
Closed

Comments

@cfjedimaster
Copy link

I scaffolded a new application with npm init vue@latest, and during the prompts, I selected YES to Cypress. After it was done, I went into the directory, ran npm i, and then tried:

npm run test:e2e

When I did, it hung at:

image

I asked around on the Cypress discord, and did some digging, and noticed the following.

If I did npm run dev, of course the Vue app worked fine. But if I ran the preview task as created during scaffolding, vite preview --port 4173, it did NOT build the Vue app. I'd hit the URL and get, "Cannot GET /" (or something like that ;).

If I remove 'preview' from the command:

    "preview": "vite --port 4173",

I can then run the test:e2e task ok.

So there's definitely a workaround, but "out of the box", it seems like the scaffolded scripts may be wrong?

@sodatea
Copy link
Member

sodatea commented Oct 13, 2022

https://github.com/vuejs/create-vue-templates/tree/v3.3.4/cypress#run-end-to-end-tests-with-cypress

The generated README has explicitly stated that build should be run before test:e2e

@sodatea sodatea closed this as completed Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants