Skip to content

Tag: jasmine

jasmine.createSpyObj with properties

When mocking dependencies in my Angular tests, I usually create a spy object using jasmine.createSpyObj: then provide it to the TestBed: When I use it in my test, I can then specify the desired return value: Now I also need to mock properties and I cannot find out how it should be done. createSpyObj does allo…

Conditional test case in jasmine

I am writing Jasmine. I want that when the response from the site is ok (site uploaded- pending 200). Run the it’s (test cases) in spec and when the site is failed to load the site the it’s (test cases) will not run. I check the response from site in before all function. And now in each it that ma…