Skip to content

CoverBot: Covered core analytics and ESM loader utilities#153

Open
tusk-dev[bot] wants to merge 2 commits intomainfrom
tusk-coverbot-Core-Files-2026-04-09-235554
Open

CoverBot: Covered core analytics and ESM loader utilities#153
tusk-dev[bot] wants to merge 2 commits intomainfrom
tusk-coverbot-Core-Files-2026-04-09-235554

Conversation

@tusk-dev
Copy link
Copy Markdown

@tusk-dev tusk-dev bot commented Apr 10, 2026

This PR contains 15 unit tests across 2 test files.

CoverBot config: Core Files

File patterns: src/core/**

Why these files?

analyticsUtils.ts had 19.4% line coverage (lowest in the report) and esmLoader.ts sat at 37.14%, both lacking test files entirely. CoverBot's tests brought both to 100% line coverage with 90% and 80.8% branch coverage respectively. These files contain branching logic critical to SDK initialization and signaling, and their low coverage represented the clearest gaps among testable core utilities. The test suite covers 2 exported functions and 5 distinct branches across both files.

Reviewers

Tagged @sohankshirsagar — authored the sole commit to both analyticsUtils.ts and esmLoader.ts

Files tested

  • src/core/analytics/analyticsUtils.ts
  • src/core/esmLoader.ts
Avg +100% line coverage gain across 2 files
Source file Line Branch
src/core/analytics/analyticsUtils.ts 100% (+100%) 90% (+90%)
src/core/esmLoader.ts 100% (+100%) 81% (+81%)

Coverage is calculated by running tests directly associated with each source file, learn more here.


View test details on Tusk ↗

@tusk-dev tusk-dev bot requested a review from sohankshirsagar April 10, 2026 00:32
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a0709f5. Configure here.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

2 issues found across 3 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/core/esmLoader.test.ts">

<violation number="1" location="src/core/esmLoader.test.ts:24">
P2: These tests mutate shared state (`_esmLoaderDeps`, `globalThis.__tuskDriftEsmLoaderRegistered`, `require('import-in-the-middle')` exports) but use `test()` instead of `test.serial()`. AVA runs tests concurrently by default within a file, so one test's mock can bleed into another, causing flaky failures. All tests in this file that touch shared mutable state should use `test.serial` instead.</violation>
</file>

<file name="src/core/analytics/analyticsUtils.test.ts">

<violation number="1" location="src/core/analytics/analyticsUtils.test.ts:26">
P2: These tests mutate shared state (`TuskDriftCore.getInstance`) via `withMockedInstance` but use `test()` instead of `test.serial()`. AVA runs tests concurrently by default, so concurrent tests could overwrite each other's mock of `getInstance`, causing flaky failures. Use `test.serial` for all tests that touch shared mutable state.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

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.

1 participant