【文件属性】:
文件名称:swift-snapshot-testing::camera_with_flash:令人愉快的Swift快照测试
文件大小:7.82MB
文件格式:ZIP
更新时间:2021-02-06 02:08:59
testing swift snapshot-testing screenshot-testing Swift
:camera_with_flash: 快照测试
令人愉快的Swift快照测试。
用法
,无需其他配置。 您可以导入SnapshotTesting模块并调用assertSnapshot函数。
import SnapshotTesting
import XCTest
class MyViewControllerTests : XCTestCase {
func testMyViewController () {
let vc = MyViewController ()
assertSnapshot ( matching : vc, as : . image )
}
}
第一次运行断言时,快照会自动记录