0

Unit test for angular 7 with Jasmine. I need to set the window.location.search value in Jasmine.

I tried the following scenarios.

window.location.search = '?param=part1' 
// It's not working. Browser reloaded or disconnected the unit test cases.

spyOnProperty(window.location, 'search').and.returnValue('?param=part1');
// Disconnected the unit test cases.

How can I set the window.location.search value?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
viji
  • 48
  • 1
  • 4

0 Answers0