I am trying to assert the values of windows object using jest. For example: Asserting google tag manager's window.dataLayer values.
How can I implement that using unit testing jest framework?
I am trying to assert the values of windows object using jest. For example: Asserting google tag manager's window.dataLayer values.
How can I implement that using unit testing jest framework?
Copyright © 2021 Jogjafile Inc.
If you want to call a object which you will find in
window.dataLayerobject, just mock the function you will call:before you test your functionality.
In case you want to use in multiple test, you can set in
beforeAll