diff --git a/Sources/MacroTesting/AssertMacro.swift b/Sources/MacroTesting/AssertMacro.swift index 855f477..6095bb8 100644 --- a/Sources/MacroTesting/AssertMacro.swift +++ b/Sources/MacroTesting/AssertMacro.swift @@ -134,7 +134,11 @@ public func assertMacro( let record = record ?? SnapshotTestingConfiguration.current?.record #endif withSnapshotTesting(record: record) { - let macros = macros ?? MacroTestingConfiguration.current.macros + #if canImport(Testing) + let macros = macros ?? MacroTestingConfiguration.current.macros ?? Test.current?.macros + #else + let macros = macros ?? MacroTestingConfiguration.current.macros + #endif guard let macros, !macros.isEmpty else { recordIssue( """