Closed haemi closed 3 years ago
I'd never considered using @Injected on a static class variable. But since static vars are only instantiated once, your only option would be to simply reassign it.
// setup
Foo.bar = Resolver.resolve(Bar.self)
// tests
that works, thanks a lot!
I have a static property, let's say
Now when I run unit tests, I would like to inject a different object in the different unit tests, like
My problem is that the first mock (with
hello
) stays and the@Injected static var bar: Bar
part does not get resolved again... Is there a way to solve this?