Skip to content

[e-m-c] add tests for ExpoAppDelegateSubscriberManager callback forwarding#41376

Merged
vonovak merged 2 commits intomainfrom
vonovak__e-m-c_add_tests_for_expoappdelegatesubscribermanager_callback_forwarding
Dec 3, 2025
Merged

[e-m-c] add tests for ExpoAppDelegateSubscriberManager callback forwarding#41376
vonovak merged 2 commits intomainfrom
vonovak__e-m-c_add_tests_for_expoappdelegatesubscribermanager_callback_forwarding

Conversation

@vonovak
Copy link
Copy Markdown
Contributor

@vonovak vonovak commented Dec 3, 2025

Why

Follow-up to #40008 which caused #37401 which was then fixed by #41185. To have confidence in app delegate subscribers, this PR adds tests for ExpoAppDelegateSubscriberManager.

How

Creates a dummy app delegate subscriber, registers it with ExpoAppDelegateSubscriberRepository and then calls the static methods on ExpoAppDelegateSubscriberManager which should be forwarded to the dummy app delegate subscriber (which we verify).

Test Plan

  • green CI

Checklist

Copy link
Copy Markdown
Contributor Author

vonovak commented Dec 3, 2025

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Dec 3, 2025
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Dec 3, 2025

The Pull Request introduced fingerprint changes against the base commit: 4df9160

Fingerprint diff
[
  {
    "op": "changed",
    "beforeSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoAutolinkingIos"
      ],
      "hash": "0ea8b2ac87a722a59e9bafc5ce85bd9e0859525a"
    },
    "afterSource": {
      "type": "dir",
      "filePath": "../../packages/expo-modules-core",
      "reasons": [
        "expoAutolinkingIos",
        "expoAutolinkingAndroid",
        "expoAutolinkingIos"
      ],
      "hash": "8362a211dc3270df9e9a17008f20d7ab17ce4900"
    }
  }
]

Generated by PR labeler 🤖

@vonovak vonovak force-pushed the vonovak__e-m-c_add_tests_for_expoappdelegatesubscribermanager_callback_forwarding branch from 18779ac to f3a12d9 Compare December 3, 2025 14:45
@vonovak vonovak marked this pull request as ready for review December 3, 2025 14:45
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 3, 2025

Subscribed to pull request

File Patterns Mentions
packages/expo-modules-core/** @Kudo, @lukmccall

Generated by CodeMention

}
}

final class ExpoAppDelegateSubscriberManagerSpec: ExpoSpec {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope it's not too much effort at this point, could you use Swift Testing instead of Quick/Nimble? We're moving away from the latter to get rid of additional 3rd-party dependencies.
Here is one good example: https://github.com/expo/expo/blob/main/packages/expo-modules-core/ios/Tests/AsyncFunctionTests.swift

@vonovak vonovak marked this pull request as draft December 3, 2025 15:22
@expo-bot
Copy link
Copy Markdown
Collaborator

expo-bot commented Dec 3, 2025

Hi there! 👋 I'm a bot whose goal is to ensure your contributions meet our guidelines.

I've found some issues in your pull request that should be addressed (click on them for more details) 👇

⚠️ Suggestion: Missing changelog entries


Your changes should be noted in the changelog, e.g.:
- add tests for ExpoAppDelegateSubscriberManager callback forwarding ([#41376](https://github.com/expo/expo/pull/41376) by [@vonovak](https://github.com/vonovak))
Read Updating Changelogs guide and consider adding an appropriate entry to the following changelogs:


Generated by ExpoBot 🤖 against b91e5f0

@vonovak vonovak requested a review from tsapeta December 3, 2025 15:51
@vonovak vonovak marked this pull request as ready for review December 3, 2025 15:52
let subscriber = MockAppDelegateSubscriber()

init() {
ExpoAppDelegateSubscriberRepository.registerSubscriber(subscriber)
Copy link
Copy Markdown
Contributor Author

@vonovak vonovak Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not strictly necessary, but might be cleaner to also have a removeSubsriber method.

now the ExpoAppDelegateSubscriberRepository ends up adding one subscriber for each test

Copy link
Copy Markdown
Contributor

@chrfalch chrfalch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, @vonovak ! Thanks :)

Copy link
Copy Markdown
Member

@gabrieldonadel gabrieldonadel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, great work!

Copy link
Copy Markdown
Contributor Author

vonovak commented Dec 3, 2025

Merge activity

  • Dec 3, 8:09 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Dec 3, 8:10 PM UTC: @vonovak merged this pull request with Graphite.

@vonovak vonovak merged commit bc2e754 into main Dec 3, 2025
18 of 19 checks passed
@vonovak vonovak deleted the vonovak__e-m-c_add_tests_for_expoappdelegatesubscribermanager_callback_forwarding branch December 3, 2025 20:10
vonovak added a commit that referenced this pull request Dec 3, 2025
…rding (#41376)

# Why

Follow-up to #40008 which caused #37401 which was then fixed by #41185. To have confidence in app delegate subscribers, this PR adds tests for `ExpoAppDelegateSubscriberManager`.

# How

 Creates a dummy app delegate subscriber, registers it with `ExpoAppDelegateSubscriberRepository` and then calls the static methods on `ExpoAppDelegateSubscriberManager` which should be forwarded to the dummy app delegate subscriber (which we verify).


# Test Plan

- green CI

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [ ] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
aleqsio pushed a commit that referenced this pull request Dec 5, 2025
…rding (#41376)

# Why

Follow-up to #40008 which caused #37401 which was then fixed by #41185. To have confidence in app delegate subscribers, this PR adds tests for `ExpoAppDelegateSubscriberManager`.

# How

 Creates a dummy app delegate subscriber, registers it with `ExpoAppDelegateSubscriberRepository` and then calls the static methods on `ExpoAppDelegateSubscriberManager` which should be forwarded to the dummy app delegate subscriber (which we verify).


# Test Plan

- green CI

# Checklist

<!--
Please check the appropriate items below if they apply to your diff.
-->

- [ ] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants