question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I’m not expecting vite to provide an E2E solution for me, but a pointer in documentation or some tips in general would be great. Maybe this issue can work just a reference to share experiences how others have approached this topic.

vue-cli provides Cypress integration which is nice. I don’t expect vite to do that.

I could add Cypress myself, but soon enough I’d probably hit one major issue: vite is not designed to perform well on initial page load in dev mode. Unless you do a lot of async imports a vite app ends up doing a lot of requests upfront which slows down Chrome (Safari seems to be performing better in this regard). This is not a great issue in dev because you rely on HMR but when running Cypress tests, full page reload happens between every test.

I can imagine something like vite --mode=production - run Cypress tests against production code (that’s good idea anyways I assume). So basically vite build but with file watching + Proxy server and other vite dev server utilities. This would be better DX than some custom dev server solution serving dist (at least the Server Proxy I’d have to share somehow).

vite --mode=production could also be useful for debugging issues that seem to show up only in production build.

any tips welcome, cheers!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Uninencommented, Jan 7, 2021

I’ve built a Vite template (vite-ts-tailwind-starter) that I use in many projects with Cypress and it works fine for my purposes. Cypress runs great both locally and in CI (pre-configured for GitLab and GitHub). It’s quite slow in CI, but e2e is always slow on CI so it hasn’t been a problem for me personally. (The default setup uses dev mode but it’s very easy to start Vite 2 in prod mode as well.)

The same setup works for Playwright as well (which gives you Safari/Webkit in addition to Chrome+FF).

1reaction
yyx990803commented, Jan 2, 2021

Shouldn’t you do the production build once and then run multiple e2e tests on that production build? Do you have Cypress open and running e2e tests on every file change?

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is End-to-End Testing? | E2E Testing Tools - Katalon
The main purpose of End-to-end (E2E) testing is to test from the end user's experience by simulating the real user scenario and validating...
Read more >
What is End To End Testing? - BrowserStack
End to end testing (E2E testing) is a software testing method that involves testing an application's workflow from beginning to end. This method ......
Read more >
What is END-To-END Testing? E2E Example - Guru99
END-TO-END TESTING is a type of Software Testing that validates the software system along with its integration with external interfaces.
Read more >
What is end-to-end testing? | CircleCI
End-to-end testing, also known as E2E testing, is a methodology used for ensuring that applications behave as expected and that the flow of ......
Read more >
What Is End-To-End Testing? - SmartBear
End-to-end testing is a methodology used in the software development lifecycle (SDLC) to test the functionality and performance of an application under ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found