Swift Testing for Compound (#5110)

This commit is contained in:
Mauro
2026-02-16 14:04:04 +01:00
committed by GitHub
parent 26bfa6ed7c
commit e8a6af1956
7 changed files with 135 additions and 122 deletions
@@ -1,7 +1,7 @@
// swiftlint:disable all
// swiftformat:disable all
import XCTest
import Testing
@testable import Compound
{% if argument.mainTarget %}
@testable import {{ argument.mainTarget }}
@@ -26,7 +26,8 @@ extension PreviewTests {
// MARK: - PreviewProvider
{% for type in types.types where (type.implements.TestablePreview or type.based.TestablePreview or type|annotated:"TestablePreview") and type.name != "TestablePreview" %}
func test{{ type.name|replace:"_Previews", "" }}() async throws {
@Test("{{ type.name|replace:"_Previews", "" }}")
func {{ type.name|replace:"_Previews", ""| lowerFirstLetter }}() async throws {
for (index, preview) in {{ type.name }}._allPreviews.enumerated() {
try await assertSnapshots(matching: preview, step: index)
}