这是我的测试:
类 ZabiTests:FBSnapshotTestCase {
var vc:UIViewController?
override func setUpWithError() throws {
super.setUp()
vc = ViewController()
recordMode = true
}
override func tearDownWithError() throws {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testExample() throws {
FBSnapshotVerifyView((vc?.view)!)
}
func testPerformanceExample() throws {
// This is an example of a performance test case.
self.measure {
// Put the code you want to measure the time of here.
}
}
}
我第一次使用 recordMode = true 运行,然后我在没有此行的情况下运行,但我仍然得到快照比较失败
(vc 是好的,红色背景而不是 nil )