Friday, 19 April 2019

Jest: Testing window.location.reload

How do I write a test that makes sure that the method reloadFn does in fact reload the window? I found this resource but I am unclear on how to expect a window reload when writing a test when that window reload happens in a given function. Thanks for the help!

const reloadFn = () => {
  window.location.reload(true);
}



from Jest: Testing window.location.reload

No comments:

Post a Comment