loktar00 / loktar00/react-lazy-load

Testing with Jest

Open
#170 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
980
Forks
163
PR merge metrics
No merged PRs in 30d

Description

Has anyone ever tested a component with Jest that was using this library? I'm having issues with some old unit tests failing due to IntersectionObserver not being defined. I'm having trouble mocking IntersectionObserver and was wondering if anyone else has run into this.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the old unit-test failure in the Jest setup and confirm that IntersectionObserver is the missing global. Check how this library's components are rendered in the tests, then verify that the tests run successfully with the required IntersectionObserver mock in place.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.