Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lazy-load jest-dom for faster tests performance#495

akaltar started this conversation inIdeas
Discussion options

Hello!

While trying to speed up tests for a larger project, I noticed that having to initialize extend-expect for every test adds quite a bit to the overall test run-time. This is about 5-10% for us, but I think it could be bigger for other projects with less overhead.
This would of-course only benefits tests that don't use jest-dom, but at least in our case only about 25% of tests used jest-dom.

Also trying to add jest-dom to a bigger test suite could slow existing tests down and prevent adoption, while lazy-loading could minimize the impact.

A solution would probably depend on importing the matchers withrequire only when a thin module is already loaded.
This could be added as a separate file to import insetupTests, eg@test-library/jest-dom/lazy

The maintenance cost of this would be having to add every new matcher to the list of matchers in the lazy loader.

I would be happy to contribute this change if this makes sense to the maintainers

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Ideas
Labels
None yet
1 participant
@akaltar

[8]ページ先頭

©2009-2025 Movatter.jp