Commit 902436f
fix(analytics): import authentication from client lib so unit suites load
The analytics commit imported `authentication` from plugins/modular-rest,
which runs GlobalOptions.set() plus chrome listeners and profile-store wiring
at module load. Three unit suites (translate.service, nibble-surface,
selection-popup) mock @modular-rest/client with only `functionProvider`, so
pulling in the plugin threw "No GlobalOptions export is defined on the mock"
and the files failed to load — yarn test dropped from 138 to 124.
Import `authentication` straight from @modular-rest/client (the same singleton
the plugin re-exports, and how functionProvider is already imported in this
file) and stub it in the three mocks. No plugin side-effects in the service.
yarn test back to 138/138; typecheck clean.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 6e3236e commit 902436f
4 files changed
Lines changed: 6 additions & 2 deletions
File tree
- src/common/services
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
| 9 | + | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
0 commit comments