Skip to content

Wild Wild Wolf

Developer. Because Superhero is not an official job title.

Menu

jsdom

Jest: How to Mock window.location.href

Jest: How to Mock window.location.href

There may be a situation where you need to mock methods or properties on window.location in Jest. However, because of peculiarities of jsdom, this could be challenging. In this post there is one of the possible solutions to this problem.

wwa November 13, 2019January 13, 2021 NodeJS No Comments Read more

Recent Posts

  • GitHub Codespaces and Automatic Port Forwarding
  • How to Sign Tags in GitHub Codespaces
  • How to Emulate a Request in WP CLI Shell
  • How to Log Request Headers with Nginx and NJS
  • How to Conditionally Disable Object Cache Drop-in

Recent Comments

  • wwa on GitHub Actions: How to Avoid Running the Same Workflow Multiple Times
  • wwa on How to Get the Source of an Uncaught Exception in C++
  • Marcel on GitHub Actions: How to Avoid Running the Same Workflow Multiple Times
  • Rodislav Moldovan on How to Expose Kubernetes Dashboard Over HTTPS
  • A on How to Get the Source of an Uncaught Exception in C++

Archives

  • February 2023
  • December 2022
  • September 2022
  • June 2022
  • January 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • January 2021
  • December 2020
  • July 2020
  • June 2020
  • May 2020
  • February 2020
  • December 2019
  • November 2019
  • October 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • March 2019
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018

Categories

  • DevOps
  • NodeJS
  • Random Thoughts
  • Server Administration
  • Uncategorized
  • WordPress
Copyright © 2023 Wild Wild Wolf. All rights reserved. Theme Spacious by ThemeGrill. Powered by: WordPress.