Skip to content

mock heavy utils import#8317

Merged
OmarZubaidi merged 2 commits into
developfrom
omar/otr-2848-fix-test-flake-libhelperscandidapitestts
Jun 22, 2026
Merged

mock heavy utils import#8317
OmarZubaidi merged 2 commits into
developfrom
omar/otr-2848-fix-test-flake-libhelperscandidapitestts

Conversation

@OmarZubaidi

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI left a comment

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.

Pull request overview

Updates the candidApi helper unit test to avoid importing/spreading the real utils package entrypoint (which can be heavy), by replacing the importOriginal-based mock with a fully self-contained vi.mock('utils', ...) factory.

Changes:

  • Replace vi.mock('utils', async (importOriginal) => ({ ...actual, ... })) with a lightweight mock that does not import the original module.
  • Add additional mocked exports (MISSING_REQUEST_SECRETS, SecretsKeys) needed by candidApi.ts when importing from utils.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/utils/lib/helpers/candidApi.test.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Omar Zubaidi <66521244+OmarZubaidi@users.noreply.github.com>
@OmarZubaidi OmarZubaidi enabled auto-merge June 22, 2026 13:49
@OmarZubaidi OmarZubaidi merged commit 39764b2 into develop Jun 22, 2026
14 checks passed
@OmarZubaidi OmarZubaidi deleted the omar/otr-2848-fix-test-flake-libhelperscandidapitestts branch June 22, 2026 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants