vite-jest
jest-dom
vite-jest | jest-dom | |
---|---|---|
5 | 23 | |
395 | 4,298 | |
- | 0.7% | |
0.0 | 7.0 | |
over 2 years ago | 5 days ago | |
JavaScript | JavaScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
vite-jest
-
Was it a mistake to start a really big project with create-react-app?
Even the most official workaround, vite-jest, still has issues to work through, like a lack of Windows support.
-
Migrating from Jest to Vitest
I had originally planned to keep using Jest during the migration of CRA to ViteJS, but I kept running into issues, mainly because Jest support for ES Modules is still experimental. There is a Vite plugin called vite-jest but it's still very much a work in progress.
- Create React App
-
Supercharge Web DX in Svelte way
Then I tried Vite. Vite also supports lots of things out of the box (especially ESM!). Its HMR - hot module replacement is blazing fast. I can also use plugin like vite-jest (switch to esbuild-jest later on) to replace Babel and speed up my tests. This is the first time I have a relatively "GOOD" DX.
- Experiences using Vite for React+Typescript projects?
jest-dom
-
Unit tests in React with Jest and Testing Library
Tests structure Queries Roles User events Matchers Jest Matchers testing-library Mock functions
-
Mastering Jest Configuration for React TypeScript Projects with Vite: A Step-by-Step Guide
//config/jest/setupTests.ts // jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom';
-
Anyone have setup instructions for Vitest + Typescript + React testing library? My setup is failing to extend matchers on Vitest Types
Update: Just got it working. Following the instructions on this github issue and using `shamefully-hoist=true` with pnpm I got it working. The issue I was facing was with pnpm.
-
Is there a jest query method for this use case?
React Testing Library uses jest-dom which has a .getByText() matcher.
-
Setting Up a Modern Preact Application With Typescript, Vite and Vitest
vitest-dom extends the standard Jest matchers with convenient methods like .toBeDisabled. Now you can write tests that assert on the state of the DOM. The package is a fork of @testing-library/jest-dom.
-
Superset: Testing and Enzyme to RTL conversion
jest-dom matchers
-
Migrating from Jest to Vitest
At the time of writing this article, it still seems to be an open issue. However, a workaround I found is to add "skipLibCheck": true, to your tsconfig.json file.
- Buenas prácticas con Angular Testing Library
-
Unable to test React-Redux Toolkit app
// jest-dom adds custom jest matchers for asserting on DOM nodes. // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom import '@testing-library/jest-dom'; import { server } from './mocks/server'; beforeAll( () => server.listen( { onUnhandledRequest: 'error' } ) ); afterEach( () => server.resetHandlers() ); afterAll( () => server.close() );
-
Setup Jest to React Typescript Vite project, also SWC (part 1)
Everything you want to do to your test environment such as extends the jest matchers with @testing-library/jest-dom, mock some APIs that’s not implemented in jdom, you can put to config/jest/setupTests.js:
What are some alternatives?
vite-material-ui - A Vite starter template for React, TypeScript, and MUI
jest - Delightful JavaScript Testing.
parcel - The zero configuration build tool for the web. 📦🚀
msw - Seamless REST/GraphQL API mocking library for browser and Node.js.
svelte-preprocess - A ✨ magical ✨ Svelte preprocessor with sensible defaults and support for: PostCSS, SCSS, Less, Stylus, Coffeescript, TypeScript, Pug and much more.
Cypress - Fast, easy and reliable testing for anything that runs in a browser.
vite-test-example - Example of setting up tests with Vite
jest-cheat-sheet - Jest cheat sheet
cookbook - VueJS + NodeJS Evergreen Cookbook
user-event - 🐕 Simulate user events
wp2vite - 一个让webpack项目支持vite的前端项目的转换工具。A front-end project automatic conversion tool。
husky - Git hooks made easy 🐶 woof!