Liftric / DIKit

Dependency Injection Framework for Swift, inspired by KOIN.
MIT License
102 stars 17 forks source link

Add a cleanup method to destroy the dependency context (for unit tests) #42

Open werner77 opened 4 years ago

werner77 commented 4 years ago

For testing it's convenient to be able to destroy the context after each test and set it up before.

werner77 commented 4 years ago

Can be as easy as:

extension DependencyContext {
    static func destroy() {
        self.root = nil
    }
}