You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(framework): expose .http, .services, .context and .telemetry on FrameworkMockConfigurator
Pin the four remaining built-in modules whose configure factories don't depend on ref, so their real configurators are reachable the same way .msal and .serviceDiscovery already are. event is deliberately left unpinned since its configure factory depends on ref for parent-scope event bubbling.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add `.http`, `.services`, `.context` and `.telemetry` accessors to `FrameworkMockConfigurator`, alongside the existing `.msal` and `.serviceDiscovery`.
6
+
7
+
These four modules have no test double yet, so a client built through `.http`, or anything read through `.services`, `.context` or `.telemetry`, still performs real I/O — but their configurators are now reachable synchronously the same way `.msal` and `.serviceDiscovery` already are, since none of their `configure` factories depend on `ref`:
`event` is intentionally left out: its `configure` factory reads `ref` to wire event bubbling to a parent event provider when `FrameworkMockConfigurator` is hoisted inside a host framework, and pinning it would call `configure()` with `ref` always `undefined` — silently disabling that bubbling.
Copy file name to clipboardExpand all lines: packages/framework/docs/testing-extending.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,4 +62,6 @@ class AppMockConfigurator extends FrameworkMockConfigurator<[InvoiceModule]> {
62
62
63
63
## What is not covered yet
64
64
65
-
The `http`, `services`, `context` and `telemetry` modules initialize but are not yet backed by test doubles, so anything issuing an actual request still reaches the network. Adding one means creating a `src/mock/` folder in **that module**, then pinning its configurator with `_pin` and exposing it with `_getConfig` on `FrameworkMockConfigurator` — the two lines the built-in mocks already use.
65
+
`.http`, `.services`, `.context` and `.telemetry` are already reachable on `FrameworkMockConfigurator` — their `configure` factories take no `ref`, so they were safe to pin the same way `.msal` and `.serviceDiscovery` are. What is missing is a test double behind them: none of the four modules has a `src/mock/` folder yet, so anything issuing an actual request through them still reaches the network. Adding one means creating that folder in **that module**, then pinning its mock configurator with `_pin` and exposing it with `_getConfig` on `FrameworkMockConfigurator`, replacing the real module descriptor pinned there today.
66
+
67
+
`event` is not pinned at all, deliberately: its `configure` factory reads `ref` to wire event bubbling to a parent event provider when `FrameworkMockConfigurator` is hoisted inside a host framework. Pinning would call `configure()` with `ref` always `undefined`, silently breaking that bubbling — so it is left to build the normal way, from the module system's own configure phase, where `ref` is actually known.
0 commit comments