vue3+vite+jest
This template is exploratory in nature trying to figure out the needed setup to get Vue 3, Vite, Vue Test Utils, Jest, and code coverage working.
This repo was initialized by running npm init vue@latest
- Jest has been set up to compile with babel-jest.
- This project has a sample test for a SFC component, a multi-file component, and a pinia store that all pass.
- Code coverage however is not properly working in this setup at the moment.
- Code coverage is collected for the SFC component and the store code but not the multi-file component.
- There is an issue logged to Jest for this here: jestjs/jest#12937
Recommended IDE Setup
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
npm run dev
Compile and Minify for Production
npm run build
Cypress Component Testing
Run Headed Component Tests withnpm run test:unit # or `npm run test:unit:ci` for headless testing
Cypress
Run End-to-End Tests withnpm run build
npm run test:e2e # or `npm run test:e2e:ci` for headless testing
ESLint
Lint withnpm run lint