user-event
angular-testing-library
Our great sponsors
user-event | angular-testing-library | |
---|---|---|
5 | 5 | |
2,118 | 678 | |
1.0% | 2.4% | |
5.6 | 7.3 | |
11 days ago | 12 days ago | |
TypeScript | TypeScript | |
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.
user-event
-
How do I test a button that change a state with jest ?
You probably want to be using user-event instead of fireEvent.
-
Mocking setTimeout with Jest
With userEvent it is different. Since version 14.0.0 the APIs always return a Promise. Because of that we need to make the whole test async and await on clicking with userEvent.
-
BDD and TDD testing for React-Node App
I just learned to do TDD by react testing library + jest + user event https://github.com/testing-library/user-event
-
Django, HTMX and Alpine.js: Modern Websites, JavaScript Optional
I just tried running WinDirStat on the `node_modules` folder in a Create-React-App project I had lying around. Total size was 234 MB. Of that, 129MB was JS files. By far the biggest piece was TypeScript, which has 45MB of .js in 6 files making up its parsing and IDE language service implementation.
Beyond that, the breakdown is:
- .ts source files: 25MB
- Sourcemaps: 23MB
- Markdown: 15MB
- JSON: 10MB
It also looks like there's a 12MB Linux binary that was only in there as a publishing accident for the `user-event` library that has since been resolved ( https://github.com/testing-library/user-event/issues/266 ).
Or, take Redux Toolkit, which I maintain. If you look at https://unpkg.com/browse/@reduxjs/[email protected]/ , the published package for our current version, it adds up to about 10MB on disk. But, that's because we ship three separate entry points (RTK core, RTK Query UI-agnostic core, RTK Query with React-specific additions), and for each entry point we compile the code to multiple file formats (CommonJS, ESM legacy, ESM modern, ESM with "dev" and "prod" already built in, UMD dev, UMD production), and each of those has sourcemaps. The actual amount of code that ends up in your bundle is about 20KB min+gz.
So, it's a combination of many things: TS itself is big, libraries typically publish packages containing both the original source code plus multiple build artifacts to run in different environments, and packages also include various metadata and other files as well.
-
Comparing Enzyme with React Testing Library
To get away from testing our code implementation and get closer to testing how the application is actually used, we turn once again to React Testing Library. Instead of creating fake DOM event objects and simulating various change events, we have the ability to mimic how users would actually interact with the application using userEvent's, which are provided by the user-event library.
angular-testing-library
-
Mi experience with unit testing in Angular: third time lucky! 💪🏻
A few months ago some colleagues told me about their smooth experience with Jest and Testing Library in a Vue application. Last week I gave it a shot. It took me a couple of hours to remove all Karma and Jasmine dependencies, and to properly configure this new testing platform. After that, I tried to refactor a small component by test driven development, again. This time, it was easier to render each component and its dependencies. However, there weren't enough enough examples and real use cases for testing the actual behavior of the components with ease (even with resources like this or this).
- Usando selectores correctos en Angular Testing Library
-
Obteniendo el mayor valor nuestros tests en Angular
Angular Testing Library Repository Buenas prácticas con Angular Testing Library
- Buenas prácticas con Angular Testing Library
- Escrevendo testes eficientes de verdade no Angular
What are some alternatives?
jest-dom - :owl: Custom jest matchers to test the state of the DOM
spectator - 🦊 🚀 A Powerful Tool to Simplify Your Angular Tests
testing-with-enzyme
ng-mocks - Angular testing library for mocking components, directives, pipes, services and facilitating TestBed setup
django-unicorn - The magical reactive component framework for Django ✨
eslint-plugin-testing-library - ESLint plugin to follow best practices and anticipate common mistakes when writing tests with Testing Library
callbag-jsx - callbags + JSX: fast and tiny interactive web apps
storybook - Storybook is a frontend workshop for building UI components and pages in isolation. Made for UI development, testing, and documentation.
blog_mocking_settimeout_with_jest - Mocking setTimeout with Jest
atl-good-testing-practices
testing-with-react-testing-library
common-testing-library-mistakes - Showcase for common mistakes when using testing-library