This is a quick base code for setting up Jest tests for our ViteJS project for React and TypeScript.
NOTE: This scaffolded project is based on ViteJS React TypeScript Template.
- Node
v16.13.0
- Yarn
v1.22.10
Install dependencies:
yarn install;
Run tests:
yarn test;
There are the main file used for testing.
Main test file:
src/__tests__/App.test.jsx
Mock used for images:
test/__mocks__/fileMock.js
Main jest config file
jest.config.ts
Main jest setup file to extend jest
jest.setup.ts