In my case, I'm using lodash. I have an Angular service which wraps the global in a service called '' so that it's obvious what it's supposed to be when you call things on it (e.g. .extend). However, since bard injects my service as a global, it clobbers the library itself, then after the first test, it removes from the global scope. The end result is that only the first test of anything which uses the service passes. The rest error at dependency injection time because the _ factory no longer returns anything.
I have fixed this issue locally in my test helper file by copying over the library to a different variable stored locally, then running a global afterEach which restores it, but such a thing would probably be good to have as a core functionality of bard.
Edited to add that _.extend is a silly example because that functionality is available via angular.extend, but the idea carries for pretty much any global library which you might wrap in an angular service for mocking purposes.
In my case, I'm using lodash. I have an Angular service which wraps the global in a service called '' so that it's obvious what it's supposed to be when you call things on it (e.g. .extend). However, since bard injects my service as a global, it clobbers the library itself, then after the first test, it removes from the global scope. The end result is that only the first test of anything which uses the service passes. The rest error at dependency injection time because the _ factory no longer returns anything.
I have fixed this issue locally in my test helper file by copying over the library to a different variable stored locally, then running a global afterEach which restores it, but such a thing would probably be good to have as a core functionality of bard.
Edited to add that _.extend is a silly example because that functionality is available via angular.extend, but the idea carries for pretty much any global library which you might wrap in an angular service for mocking purposes.