Last active
September 19, 2022 03:51
-
-
Save jimkeller/fc60197ea1501886efb0721380090bf1 to your computer and use it in GitHub Desktop.
Mocking scrollHeight in Jest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const my_element = document.getElementById('my-element') | |
jest.spyOn(my_element, "scrollHeight", 'get').mockReturnValue(100) //return 100 as scrollHeight | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment