How do we clear spy programmatically in Jasmine?

后端 未结 10 2276
孤独总比滥情好
孤独总比滥情好 2020-12-15 02:11

How do we clear the spy in a jasmine test suite programmatically? Thanks.

beforeEach(function() {
  spyOn($, \"ajax\").andCallFake(function(params){
  })
})
         


        
10条回答
  •  醉梦人生
    2020-12-15 02:51

    From jasmine 2.5, you can use this global setting to update a spy within your test cases:

    jasmine.getEnv().allowRespy(true);
    

提交回复
热议问题