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

Cypress tests fail with default templates #24

Closed
robyedlin opened this issue Jan 6, 2022 · 9 comments
Closed

Cypress tests fail with default templates #24

robyedlin opened this issue Jan 6, 2022 · 9 comments

Comments

@robyedlin
Copy link

Steps to reproduce

Create a new project with Cypress > yes
Via npm init vue@latest

Problem 1

Running npm run test:unit:ci fails

Details:

[vite] Internal server error: Cannot read property 'uid' of undefined
  Plugin: vite:import-analysis
  File: ../with-tests/src/components/__tests__/HelloWorld.spec.js

Problem 2

Running npm run test:e2e:ci fails with hanging server

Details:

  • No files are built in /dist folder, thus server returns CANNOT GET /
@robyedlin robyedlin changed the title Cypress tests fail Cypress tests fail with default templates Jan 6, 2022
@haoqunjiang
Copy link
Member

Cannot reproduce.

  1. Do you have a reproduction repo?
  2. What's your OS and Node.js version?

@haoqunjiang
Copy link
Member

For problem 2, you need to run npm run build before npm run test:e2e:ci.

@robyedlin
Copy link
Author

robyedlin commented Jan 7, 2022

Problem 1: I'm using github codespaces, which is node 14 and linux. I will add a repo, but it's the repo generated by npm init vue@latest
Problem 2: Yes, that's what I'm currently doing. But shouldn't npm run build be part of the test:e2e:ci script then, so that it won't hang? I can submit a PR for that.

@robyedlin
Copy link
Author

robyedlin commented Jan 7, 2022

@haoqunjiang
Copy link
Member

haoqunjiang commented Jan 7, 2022

The cause is similar to this: browserify/resolve#264 (comment)
Cypress has bundled a problematic version of graceful-fs and its polyfill breaks the newest version of resolve.

@haoqunjiang
Copy link
Member

I've reported it to Cypress: cypress-io/cypress#19610

@haoqunjiang
Copy link
Member

Problem 2: Yes, that's what I'm currently doing. But shouldn't npm run build be part of the test:e2e:ci script then, so that it won't hang? I can submit a PR for that.

I'm not sure about this.

Sometimes users may want to change the Cypress configuration and rerun the e2e tests without rebuilding.
Considering npm run build is very costly, I think the two steps should be separate.

@robyedlin
Copy link
Author

robyedlin commented Jan 7, 2022

Ok, that's fair

@haoqunjiang
Copy link
Member

Fixed in Cypress 9.3.0

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