Calling flushPendingTestArtifacts could have a flag to fully reset the main window to an empty view controller. Right now, if I call UIViewController.flushPendingTestArtifacts() in my setUp and tearDown for my tests does not guarantee that my environment is in a clean state for the next test.
This bit me when my controller I had been testing had calls to a dependency in the viewWillDisappear which then executed while running another test that was expecting to be the only one calling that dependency.
Right now my workaround is to do:
UIViewController.flushPendingTestArtifacts()
UIViewController().loadForTesting()
Calling flushPendingTestArtifacts could have a flag to fully reset the main window to an empty view controller. Right now, if I call
UIViewController.flushPendingTestArtifacts()in mysetUpandtearDownfor my tests does not guarantee that my environment is in a clean state for the next test.This bit me when my controller I had been testing had calls to a dependency in the
viewWillDisappearwhich then executed while running another test that was expecting to be the only one calling that dependency.Right now my workaround is to do: