I need to throw an exception if a utility is used outside of an 'it' or 'beforeEach' block in my tests. Example -
describe('some test', function(){
useUtil(); // should throw exception
beforeEach(function(){
useUtil() // should work
})
it('should test something', function(){
useUtil() // should work
})
})
The util creates spies, and I want to make sure they are create in a way that allows Jasmine to clean them after every suite.
Aucun commentaire:
Enregistrer un commentaire