How to test usage of notificationCenter #42
Unanswered
martin-muller
asked this question in
Q&A
Replies: 1 comment
-
Hey @martin-muller! The initial variant of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I'm wondering what's the best approach to test that my client has sent a notification.
My initial instinct was to override the
notificationCenter
dependency usingwithDependencies
and either create a whole newNotificationCenter.Dependency
or override just thepost
and assert that the call was made, but the init is internal and the funcs are internal lets. Then I thought I can importDependenciesAdditions
as testable and have the init available, but weirdly enough that didn't work, maybe something in our setup.Im aware there is public init that takes
NotificationCenter
, but since we already have the wrapper client objectNotificationCenter.Dependency
, it seems like unnecessary complication to use the Foundation'sNotificationCenter
for testing.Thank you for the wonderful library!
Beta Was this translation helpful? Give feedback.
All reactions