Commit 0d51816
test: backfill coverage for genie connector, service context, stream registry (#327)
* test: backfill coverage for genie connector, service context, stream registry
Pure test additions for existing code — no production behavior changes.
Coverage deltas:
- genie connector: 61% → ~97%
- service-context: 7% → 100%
- stream-registry: 32% → 100%
Carved out of #256 to land independently. Tests exercise existing code paths
that were under-covered, surfaced while reworking the analytics format model.
Co-authored-by: Isaac
* test(service-context): add ConfigError to sdk-experimental mock
ServiceContext.initialize's catch branch uses `e instanceof ConfigError`
imported from @databricks/sdk-experimental. The vi.mock only exported
WorkspaceClient, so the import resolved to undefined and vitest's strict
mock validation threw `No "ConfigError" export is defined` whenever the
catch path ran — failing 6 tests in service-context.test.ts after merging
main.
Add a minimal ConfigError class with the `baseMessage` field
ConfigurationError.databricksAuthenticationSetupFailed reads, so the
instanceof check evaluates cleanly without changing production behavior.
Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
* fixup: move MockConfigError into vi.hoisted block
vi.mock is hoisted to the top of the file, so MockConfigError defined as
a top-level class declaration was not yet initialised when the mock
factory ran (ReferenceError: Cannot access 'MockConfigError' before
initialization). Move the class into the existing vi.hoisted block so
it is constructed before vi.mock executes.
Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
* fixup: assert initialize() rejects, not lazy state.warehouseId/.workspaceId
ServiceContext.initialize() eagerly resolves workspaceId and warehouseId
inside Promise.all, so any failure surfaces as a rejection of
initialize() itself — the state object is never produced. Five "should
throw …" tests awaited initialize() and then asserted on
state.workspaceId/state.warehouseId, which meant the rejection escaped
to the outer test as an unhandled error before the rejects.toThrow
assertion ran.
Move the assertion onto the initialize() call. No production change.
Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>
---------
Signed-off-by: James Broadhead <jamesbroadhead@gmail.com>1 parent 354644a commit 0d51816
3 files changed
Lines changed: 1835 additions & 0 deletions
File tree
- packages/appkit/src
- connectors/genie/tests
- context/tests
- stream/tests
0 commit comments