Skip to content

Commit 36384b0

Browse files
fadi-georgeclaude
andcommitted
test: [SDK-5382] match the startup diagnostics log instead of counting every event
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 50b0a71 commit 36384b0

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎OneSignalSDK/onesignal/core/src/test/java/com/onesignal/internal/StartupDiagnosticsTest.kt‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ class StartupDiagnosticsTest : FunSpec({
3939
Logging.logLevel = LogLevel.NONE
4040
oneSignal.logStartupDiagnostics(context)
4141

42-
events.size shouldBe 1
43-
events.single().level shouldBe LogLevel.WARN
44-
events.single().entry shouldContain "observabilityModule=logger"
45-
events.single().entry shouldContain "app=com.example@1.2.3"
46-
events.single().entry shouldContain "crashDir=${getCrashStoragePath(context)}"
42+
// The listener is global, so background work left by other specs can log here too.
43+
val diagnostics = events.single { it.entry.contains("observabilityModule=") }
44+
diagnostics.level shouldBe LogLevel.WARN
45+
diagnostics.entry shouldContain "observabilityModule=logger"
46+
diagnostics.entry shouldContain "app=com.example@1.2.3"
47+
diagnostics.entry shouldContain "crashDir=${getCrashStoragePath(context)}"
4748
}
4849
})

0 commit comments

Comments
 (0)