Nimble-SnapshotTesting

CI Version License Platform

一个 Nimble 匹配器,用于 https://github.com/pointfreeco/swift-snapshot-testing,其灵感来源于 https://github.com/ashfurrow/Nimble-Snapshotshttps://github.com/Killectro/swift-snapshot-testing-nimble 中的工作。

示例

要运行示例项目,请先克隆仓库,并从 Example 目录运行 pod install

要求

CocoaPods 或 Swift 5.3 或更高版本,用于 Swift 包管理器

安装

Nimble-SnapshotTesting 可通过 CocoaPods 获取。要安装它,只需将以下行添加到你的 Podfile 中

pod 'Nimble-SnapshotTesting'

对于 Swift 包管理器

.package(url: "https://github.com/tahirmt/Nimble-SnapshotTesting.git", .upToNextMajor(from: "2.0.0")),

用法

要将此库与 Nimble 一起使用,你有两种方式

let view = UIView()
expect(view).to(haveValidSnapshot(as: .image))

或者你甚至可以使用 == 语法

let view = UIView()
expect(view) == snapshot(as: .image)

许可证

Nimble-SnapshotTesting 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。