File tree Expand file tree Collapse file tree 4 files changed +11
-8
lines changed
Sources/AnalyticsLive/Filters Expand file tree Collapse file tree 4 files changed +11
-8
lines changed Original file line number Diff line number Diff line change 1+ {}
Original file line number Diff line number Diff line change @@ -78,9 +78,13 @@ public class DestinationFilters: UtilityPlugin {
7878
7979 public func configure( analytics: Analytics ) {
8080 self . analytics = analytics
81-
81+
8282 if let e = analytics. find ( pluginType: LivePlugins . self) {
8383 e. addDependent ( plugin: self )
84+ } else {
85+ let e = LivePlugins ( fallbackFileURL: nil )
86+ analytics. add ( plugin: e)
87+ e. addDependent ( plugin: self )
8488 }
8589 }
8690
Original file line number Diff line number Diff line change @@ -38,11 +38,15 @@ final class AnalyticsFilters_SwiftTests: XCTestCase {
3838
3939 analytics. add ( plugin: inputReader)
4040
41- analytics. add ( plugin: LivePlugins ( fallbackFileURL: nil ) )
41+ // Filters should add LivePlugins on its own.
42+ //analytics.add(plugin: LivePlugins(fallbackFileURL: nil))
4243 analytics. add ( plugin: filters)
4344
4445 waitUntilStarted ( analytics: analytics)
4546
47+ let e = analytics. find ( pluginType: LivePlugins . self)
48+ XCTAssertTrue ( e != nil )
49+
4650 analytics. track ( name: " sampleEvent " )
4751 RunLoop . main. run ( until: Date . distantPast)
4852 let inputEvent : TrackEvent ? = inputReader. lastEvent as? TrackEvent
Original file line number Diff line number Diff line change 11import XCTest
22@testable import AnalyticsLive
33
4- final class SignalsTests : XCTestCase {
5- func testDebugCheck( ) {
6- let debug = isAppRunningInDebug ( )
7- XCTAssertTrue ( debug)
8- }
9- }
You can’t perform that action at this time.
0 commit comments