Skip to content

test: trim redundant e2e tests, move pure logic to unit specs - #10651

Open
davidfirst wants to merge 110 commits into
masterfrom
e2e-cleanup
Open

davidfirst wants to merge 110 commits into
masterfrom
e2e-cleanup

Conversation

@davidfirst

Copy link
Copy Markdown
Member

This PR reduces the number of slow e2e tests. The work goes file by file. Each commit covers one e2e file.

  • Remove e2e tests that a unit spec already covers.
  • Remove e2e tests that repeat the same code path as a sibling test.
  • Move tests of pure functions to unit specs. Example: main-file resolution now has a unit spec (determine-main-file.spec.ts) with 9 tests.
  • Keep all tests that need a real workspace or scope.

Done so far: add.e2e.ts (24 to 13 tests), config.e2e.ts (13 to 11 tests). More commits will follow on this branch.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Tests: trim redundant add/config e2e coverage; add determineMainFile unit specs

🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Remove redundant/overlapping e2e cases in bit add and bit config suites to reduce runtime.
• Add focused unit coverage for determineMainFile() main-file resolution strategies.
• Simplify e2e assertions where coverage is already exercised by remaining tests.
Diagram

graph TD
  E2EAdd(["e2e/commands/add.e2e.ts"]) --> CLI["bit CLI"] --> AddComp["AddComponents"] --> DMF["determineMainFile()"]
  E2EConfig(["e2e/commands/config.e2e.ts"]) --> CLI
  UnitSpec(["scopes/component/tracker/determine-main-file.spec.ts"]) --> DMF
Loading
High-Level Assessment

The approach is appropriate: keep e2e coverage for behaviors requiring a real workspace/CLI, and move deterministic strategy logic (main-file resolution) into fast unit specs to reduce suite time. Alternatives like keeping all scenarios as e2e or introducing a mid-level integration harness would be slower or add more framework surface area without clear benefit here.

Files changed (3) +87 / -110

Tests (3) +87 / -110
add.e2e.tsRemove redundant 'bit add' e2e cases (main-file + invalid id/name) +1/-88

Remove redundant 'bit add' e2e cases (main-file + invalid id/name)

• Drops multiple 'bit add' e2e tests that duplicate existing validation or are better covered at the logic level (e.g., missing main file, invalid name/id, multiple index-file main resolution, bitmap sorting). Simplifies the gitignore scenario by removing redundant output/bitmap presence assertions while keeping the key file-filtering check.

e2e/commands/add.e2e.ts

config.e2e.tsRemove 'bit config' git propagation e2e block +0/-22

Remove 'bit config' git propagation e2e block

• Eliminates the e2e suite section that validated config precedence/propagation via git config layers, keeping the remaining local workspace/scope config tests intact. This reduces slow/permission-sensitive git-dependent coverage.

e2e/commands/config.e2e.ts

determine-main-file.spec.tsAdd unit spec for 'determineMainFile()' resolution strategies +86/-0

Add unit spec for 'determineMainFile()' resolution strategies

• Introduces a dedicated unit test suite covering the main-file selection strategies: no-match error, single-file selection, closest index preference, immediate-dir filename fallback, Angular entry point, preservation of existing component-map mainFile, and user-specified main file behavior (present vs missing). This replaces several slower e2e scenarios with direct logic validation.

scopes/component/tracker/determine-main-file.spec.ts

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Aug 20, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (3) 📜 Skill insights (0)

⚠️ 7 lower-priority findings omitted to fit the comment size limit; re-run the review or view the findings in the Qodo portal.

Grey Divider


Action required

1. Custom-path imports lose coverage 🐞 Bug ☼ Reliability
Description
The deleted bit import --path destination suite was the only command-level coverage for successful
writes to an empty directory, rejection and content preservation for a non-empty directory,
overwrite behavior with --override, and rejection when the target is an existing file. These cases
reach separate component-writer conflict branches from the surviving non-existent-destination test,
so regressions in destination handling and safeguards against overwriting user files no longer fail
an integration test.
Code

e2e/commands/import.e2e.ts[L160-163]

-        describe('when the destination is an existing empty directory', () => {
-          before(() => {
-            helper.scopeHelper.reInitWorkspace();
-            helper.scopeHelper.addRemoteScope();
Evidence
The surviving import test covers only a destination that does not yet exist, while the component
writer explicitly distinguishes existing file targets, non-empty directories, and occupied-directory
behavior gated by the overwrite option. Because the retained suite no longer includes the deleted
destination group, none of these separate conflict and preservation branches is exercised through
the command.

scopes/component/component-writer/component-writer.main.runtime.ts[275-284]
scopes/component/component-writer/component-writer.main.runtime.ts[340-357]
e2e/commands/import.e2e.ts[144-159]
scopes/scope/importer/import-components.ts[1094-1110]
scopes/component/component-writer/component-writer.main.runtime.ts[333-358]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The `bit import --path` destination scenarios were removed even though empty directories, occupied directories, existing file targets, and override behavior follow distinct component-writer paths. Command-level coverage should verify both successful destination handling and safeguards that preserve existing user content.
## Fix Focus Areas
- e2e/commands/import.e2e.ts[160-223]
- scopes/component/component-writer/component-writer.main.runtime.ts[333-358]
## Recommended Fix
Restore focused destination tests that verify import into an empty directory, rejection of a non-empty destination without deleting or changing its existing content, successful replacement of a directory with `--override`, and rejection when the destination is a file both with and without `--override`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Status can regress for mismatched envs 🐞 Bug ⚙ Maintainability
Description
The version-mismatch scenario removes its helper.command.status() assertion and now exercises only
environment resolution and bit show. When a component references an older env version in its model
while the workspace has a newer version, status-specific extension loading can fail without reaching
either remaining assertion.
Code

e2e/harmony/custom-env-operations.e2e.ts[L71-73]

-    it('any bit command should not throw', () => {
-      expect(() => helper.command.status()).to.not.throw();
-    });
Evidence
The surviving scenario constructs the specific model/workspace version mismatch, but its only
remaining tests call getComponentEnv() and showComponent(); neither invokes status. The deleted
assertion was therefore the sole test execution of status for this loading path.

e2e/harmony/custom-env-operations.e2e.ts[53-78]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
The custom-env version-mismatch scenario must continue to execute `bit status`, because its extension-loading path is distinct from the remaining `bit show` and environment-resolution checks.
Fix Focus Areas
- e2e/harmony/custom-env-operations.e2e.ts[53-78]
Recommended Fix
Add back an assertion in this scenario that invokes `helper.command.status()` and verifies it does not throw, retaining the existing assertions for the resolved workspace env version and the absence of the stale model version.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Snap package manifests can become invalid 🐞 Bug ⚙ Maintainability
Description
The deleted ~ prefix suite was the only test that snaps components with `componentRangePrefix:
'~'` and verifies that hash versions do not receive that prefix in dependency data or generated
package metadata. The remaining snap suite configures only ^, while the versioning code handles
^ and ~ as separate supported values in the conditions that must exclude snap versions.
Code

e2e/harmony/dependency-resolver.e2e.ts[724]

-        helper.command.snapAllComponents();
Evidence
The current tests cover the snap exclusion only after setting the prefix to ^. The workspace
configuration explicitly supports ~, and both dependency update paths independently compare the
prefix against ^ and ~ before adding a range, so the removed scenario covered a valid distinct
configuration.

e2e/harmony/dependency-resolver.e2e.ts[643-675]
scopes/dependencies/dependency-resolver/dependency-resolver-workspace-config.ts[5-9]
scopes/component/snapping/version-maker.ts[725-731]
scopes/component/snapping/version-maker.ts[737-751]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
Issue description
Snap versions must remain unprefixed when the component range configuration is `~`; this configuration is supported and has a distinct input branch from the surviving `^` scenario.
Fix Focus Areas
- e2e/harmony/dependency-resolver.e2e.ts[643-676]
Recommended Fix
Restore a `componentRangePrefix: '~'` snap scenario that asserts both dependency resolver data and the generated package manifest omit `~` from hash-version dependencies, alongside the existing caret-prefix coverage.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


View action required (6)
4. Remote pattern exclusions can regress unnoticed 🐞 Bug ⚙ Maintainability
Description
The deleted remote tests are the only ones that invoke bit pattern --remote with negated exact and
wildcard patterns. Remote matching first excludes negations while selecting remote scopes and only
then applies them to the fetched ID pool, whereas the surviving negation tests use the separate
local workspace path.
Code

e2e/commands/pattern.e2e.ts[L175-179]

-    it('should support exclusion patterns from remote', () => {
-      const result = helper.command.pattern(`${scopeName}/utils/is/*, !${scopeName}/utils/is/type`, '--remote');
-      expect(result).to.include('utils/is/string');
-      expect(result).to.not.include('utils/is/type');
-      expect(result).to.include('found 1 component');
Evidence
getRemoteIds() deliberately removes negations before deriving the remote scopes to list, then
applies the complete include/exclude pattern only after those IDs have been fetched. The remaining
remote cases contain only positive patterns, while the remaining negation cases execute
workspace.idsByPattern() rather than this remote flow.

scopes/workspace/workspace/pattern.cmd.ts[67-92]
e2e/commands/pattern.e2e.ts[72-91]
e2e/commands/pattern.e2e.ts[95-145]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Remote exclusion patterns have a distinct fetch-then-filter implementation path and are no longer exercised by an end-to-end test.
## Fix Focus Areas
- e2e/commands/pattern.e2e.ts[175-187]
## Recommended Fix
Restore an active `--remote` test that includes a positive scoped pattern plus an exact negated pattern, and retain or add a wildcard-negation case. Assert that excluded remote IDs are absent and the expected remaining IDs/count are returned.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Fractional depth validation loses coverage 🐞 Bug ⚙ Maintainability
Description
The consolidated validation test retains zero and nonnumeric values but deletes the 1.5 invocation
of --dependencies-depth. The command converts the supplied string with Number() and rejects it
through Number.isInteger(), so a regression accepting fractional numeric values is not exercised
by the surviving cases.
Code

e2e/commands/import.e2e.ts[L559-563]

-      it('should error when --dependencies-depth is a fractional number', () => {
-        const output = helper.general.runWithTryCatch(
-          `bit import ${helper.scopes.remote}/comp1 --dependencies --dependencies-depth 1.5`
-        );
-        expect(output).to.have.string('positive integer');
+        expect(nonIntOutput).to.have.string('positive integer');
Evidence
The surviving test covers the lower-bound branch with 0 and the non-integer branch with abc, but
no longer supplies a numeric value that parses successfully before failing the integer check.
Production validates exactly this converted numeric value with Number.isInteger().

e2e/commands/import.e2e.ts[471-493]
scopes/scope/importer/import.cmd.ts[324-332]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The validation suite no longer verifies rejection of a numeric fractional dependency depth.
## Fix Focus Areas
- e2e/commands/import.e2e.ts[483-493]
## Recommended Fix
Add `--dependencies-depth 1.5` to the consolidated positive-integer validation test and assert that its output contains `positive integer`, alongside the zero and nonnumeric cases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. Modified component sorting can regress ⊘ Outdated 🐞 Bug ⚙ Maintainability
Description
The removed populateComponents(..., 'v2') block stages revisions of existing components and
deletes the assertion that their staged-status output is alphabetical. The surviving staged
assertion runs immediately after initial tagging, while the formatter emits stagedComponents in
the received order, so a changed ordering in the modified-component status path can pass the suite.
Code

e2e/flows/sort-components-output.e2e.ts[L75-81]

-          it('should show all of them under staged components', () => {
-            expect(output).to.not.have.string('no staged components');
-            expect(output).to.have.string('staged components');
-          });
-          it('should show staged components sorted alphabetically', () => {
-            expectComponentsToBeSortedAlphabetically(output);
-          });
Evidence
The fixture rewrites each component file and invokes addComponent() for each one, making this a
modified-existing-component lifecycle rather than the initial tagging state retained in the file.
The status formatter does not sort the staged list itself, so the deleted assertion checks ordering
supplied by the upstream modified-component status path.

e2e/flows/sort-components-output.e2e.ts[45-89]
components/legacy/e2e-helper/e2e-fixtures-helper.ts[132-152]
scopes/component/status/status-formatter.ts[225-227]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Staged output ordering is no longer tested after existing components are modified and re-added.
## Fix Focus Areas
- e2e/flows/sort-components-output.e2e.ts[66-87]
## Recommended Fix
Restore the modified-components setup using `populateComponents(undefined, undefined, 'v2')` and assert that `bit status` lists its staged components alphabetically. Keep the existing initial-tagging assertion as separate coverage for that lifecycle state.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


7. Config precedence loses coverage 📘 Rule violation ☼ Reliability
Description
The deleted git propagation scenario is the only test that writes the same key through Bit and Git
configuration before invoking bit config get. When a repository contains competing local or global
Git values, a regression that returns those values instead of the Bit value can pass the suite.
Code

e2e/commands/config.e2e.ts[L53-55]

-    it('should read config from bit if exists', () => {
-      const confVal = helper.command.runCmd('bit config get conf.key');
-      expect(confVal).to.have.string('bit-value\n');
Evidence
Rule 2 requires retaining necessary E2E coverage for scenarios that genuinely need a real workspace.
The deleted test initializes Git, installs conflicting values in multiple stores, and verifies the
Bit value wins, while the surviving configuration tests only cover Bit-managed stores.

CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead
e2e/commands/config.e2e.ts[43-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Restore integration coverage proving that Bit configuration takes precedence over Git local and global configuration.
## Issue Context
The scenario requires a real Git repository and exercises configuration sources that the remaining Bit-only tests do not reach.
## Fix Focus Areas
- e2e/commands/config.e2e.ts[43-62]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


8. Wildcard internalization loses coverage 📘 Rule violation ☼ Reliability
Description
The deleted scenario passes ** to internalizeComponents() and verifies that all three matching
components become internal, uniquely exercising wildcard resolution and the per-ID bitmap updates
performed for multiple matches. The surviving internalize scenarios use exact component identifiers
and check only one component, while the remaining pattern assertion runs the separate bit pattern
command, so failures in wildcard selection or multi-component workspace mutation no longer fail an
integration test.
Code

e2e/harmony/internalize.e2e.ts[L94-97]

-      helper.fixtures.populateComponents(3);
-      helper.command.tagAllWithoutBuild();
-      helper.command.internalizeComponents('**');
-    });
Evidence
The removed test combines tagging, wildcard selection, workspace mutation, and command-output
verification by internalizing and asserting all three matched components. In contrast, the surviving
test internalizes only comp2, and its pattern assertion exercises the separate bit pattern
command; because the implementation resolves every matching ID, applies bitmap configuration to
each, and writes the resulting multi-component state, only the deleted wildcard scenario provided
E2E coverage of that full path.

CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead
e2e/harmony/internalize.e2e.ts[14-20]
e2e/harmony/internalize.e2e.ts[74-80]
e2e/harmony/internalize.e2e.ts[14-43]
e2e/harmony/internalize.e2e.ts[74-107]
scopes/component/internalize/internalize.main.runtime.ts[83-109]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Restore active E2E coverage that internalizes every component matched by a wildcard selector and verifies that all matched components become internal.
## Issue Context
The remaining internalize scenarios invoke the command with exact identifiers and exercise only one component. Although a surviving assertion uses a pattern, it invokes the separate `bit pattern` command; it does not cover `internalizeComponents()` resolving multiple IDs, updating bitmap configuration for each ID, writing the multi-component workspace state, and reporting the command result.
## Fix Focus Areas
- e2e/harmony/internalize.e2e.ts[91-107]
- scopes/component/internalize/internalize.main.runtime.ts[83-109]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


9. Deleted lane environments go untested 📘 Rule violation ☼ Reliability
Description
The removed lanes with various issues scenario deletes a custom environment referenced by three
components on an exported lane and checks both the removed-environment status issue and bit envs
output. No surviving lane scenario combines remote export, environment deletion, status issue
detection, and deleted-environment reporting, so regressions across that flow can pass.
Code

e2e/harmony/lanes/lanes-with-issues.e2e.ts[L57-60]

-      helper.command.softRemoveOnLane(envName);
-    });
-    it('bit status should show an issue about the missing env', () => {
-      helper.command.expectStatusToHaveIssue(IssuesClasses.RemovedEnv.name);
Evidence
Rule 2 requires adequate E2E coverage where a flow genuinely depends on a workspace, remote scope,
and multiple commands. The deleted block is the only such scenario for an environment removed while
lane components still reference it; the remaining file covers only missing object behavior during
lane diff.

CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead: CLAUDE.md: Prefer Efficient Unit Tests and Minimize E2E Test Overhead
e2e/harmony/lanes/lanes-with-issues.e2e.ts[15-38]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Restore the E2E scenario for deleting a custom environment used by components on a remote lane.
## Issue Context
This behavior spans workspace configuration, tagging, lane snapshots, remote exports, soft removal, status issues, and environment reporting.
## Fix Focus Areas
- e2e/harmony/lanes/lanes-with-issues.e2e.ts[41-67]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: 🧠 Deep: This broad 104-file test-suite rewrite spans 245 independent edit sites across commands, workspace behavior, lanes, configuration, and component lifecycle paths, creating many independent coverage regressions that a redundant review pass could plausibly catch.

Grey Divider

Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread scopes/component/tracker/determine-main-file.spec.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 23f127b

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit c9b3b48

Comment thread scopes/component/tracker/determine-main-file.spec.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d064888

Comment thread scopes/component/tracker/determine-main-file.spec.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 8d4db88

Comment thread e2e/commands/config.e2e.ts
Comment thread e2e/commands/import.e2e.ts
Comment thread e2e/commands/init.e2e.ts
Comment thread e2e/commands/init.e2e.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d15dbd2

Comment thread e2e/commands/import.e2e.ts
Comment thread e2e/commands/add.e2e.ts
Comment thread e2e/commands/pattern.e2e.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit ec76886

Comment thread e2e/commands/pattern.e2e.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 0b6f4b3

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 42014fb

Comment on lines -75 to 77
it('should not install a package "undefined" ', () => {
expect(path.join(helper.scopes.localPath, 'node_modules/undefined')).to.not.be.a.path;
});
describe('after importing the file', () => {
before(() => {
helper.scopeHelper.reInitWorkspace();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

15. Binary exports can create an undefined package 🐞 Bug ≡ Correctness

The binary export scenario no longer checks that the export operation leaves
node_modules/undefined absent. Its remaining assertions only verify remote listing output and PNG
byte preservation, so a dependency-resolution regression that creates that bogus package after
export reaches the workspace without failing this suite.
Agent Prompt
## Issue description
Restore the active export regression check that verifies a binary component export does not create `node_modules/undefined` in the workspace.

## Fix Focus Areas
- e2e/functionalities/binary-files.e2e.ts[23-52]

## Recommended Fix
After the binary-plus-JavaScript export setup, reintroduce an assertion that `path.join(helper.scopes.localPath, 'node_modules/undefined')` does not exist. Keep it in this scenario so the export cleanup path remains covered.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines -89 to 92
expect(comp1.devPackageDependencies).to.be.an('object').that.has.property('chai');
});
it('should not save "chai" in the packages', () => {
expect(comp1.packageDependencies).to.be.an('object').that.is.empty;
});
it('should not save anything into dependencies', () => {
expect(comp1.dependencies).to.be.an('array').that.is.empty;
});
it('should save the flattened dev-dependencies into flattened-dependencies', () => {
expect(comp1.flattenedDependencies).to.be.an('array').with.lengthOf(2);
});
it('bit status should not show any component as modified', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

16. Test-only packages can be classified as runtime 🐞 Bug ≡ Correctness

The "without dependencies and with dev-dependencies" case no longer checks
comp1.devPackageDependencies for chai or verifies that comp1.packageDependencies is empty. It
creates chai usage only in foo.spec.js, so an analyzer regression that records that package as a
runtime dependency still satisfies the remaining component and flattened-dependency assertions.
Agent Prompt
## Issue description
Restore assertions that distinguish the package required solely from a test file from runtime package dependencies.

## Fix Focus Areas
- e2e/functionalities/dev-dependencies.e2e.ts[55-95]

## Recommended Fix
In the "without dependencies and with dev-dependencies" scenario, assert that `chai` exists in `comp1.devPackageDependencies` and that `comp1.packageDependencies` is empty, alongside the retained component dependency assertions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines -154 to 157
it('adds peer dependency to the generated package.json', () => {
const pkgJson = fs.readJsonSync(
path.join(workspaceCapsulesRootDir, `${helper.scopes.remote}_comp1/package.json`)
);
expect(pkgJson.peerDependencies).to.deep.equal({
[`@${helper.scopes.remote}/comp2`]: '^0.0.1-new',
});
});
describe('peer dependency is not broken after snap', () => {
before(() => {
helper.command.snapAllComponents();
helper.command.build();
workspaceCapsulesRootDir = helper.command.capsuleListParsed().workspaceCapsulesRootDir;
});
it('should save the peer dependency in the model', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

17. Prefix peer ranges can produce invalid capsules 🐞 Bug ≡ Correctness

The prefix-range setPeer('comp2', '^') flow still builds capsules before and after snapping, but
the PR deletes both generated package.json assertions. The retained assertions inspect model and
scope dependency metadata only, whereas capsule generation must normalize the unsnapped ^0.0.1-new
range and the snapped prerelease range for a package manifest.
Agent Prompt
## Issue description
Restore capsule manifest assertions for peer dependencies configured with the `^` range prefix, both before and after snapping.

## Fix Focus Areas
- e2e/functionalities/peer-dependency-component.e2e.ts[120-183]

## Recommended Fix
Capture the workspace capsule root after each build in the prefix-range scenario and assert that the relevant generated component `package.json` has the expected peer dependency range before snapping and after snapping. Preserve the existing model and scope assertions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines -71 to 73
it('any bit command should not throw', () => {
expect(() => helper.command.status()).to.not.throw();
});
it('bit show should show the correct env', () => {
const env = helper.env.getComponentEnv('comp1');
expect(env).to.equal(`${envId}@0.0.2`);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Status can regress for mismatched envs 🐞 Bug ⚙ Maintainability

The version-mismatch scenario removes its helper.command.status() assertion and now exercises only
environment resolution and bit show. When a component references an older env version in its model
while the workspace has a newer version, status-specific extension loading can fail without reaching
either remaining assertion.
Agent Prompt
Issue description
The custom-env version-mismatch scenario must continue to execute `bit status`, because its extension-loading path is distinct from the remaining `bit show` and environment-resolution checks.

Fix Focus Areas
- e2e/harmony/custom-env-operations.e2e.ts[53-78]

Recommended Fix
Add back an assertion in this scenario that invokes `helper.command.status()` and verifies it does not throw, retaining the existing assertions for the resolved workspace env version and the absence of the stale model version.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

helper.scopeHelper.reInitWorkspace();
helper.fixtures.populateComponents(2);
helper.workspaceJsonc.addKeyValToDependencyResolver('componentRangePrefix', '~');
helper.command.snapAllComponents();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

2. Snap package manifests can become invalid 🐞 Bug ⚙ Maintainability

The deleted ~ prefix suite was the only test that snaps components with `componentRangePrefix:
'~'` and verifies that hash versions do not receive that prefix in dependency data or generated
package metadata. The remaining snap suite configures only ^, while the versioning code handles
^ and ~ as separate supported values in the conditions that must exclude snap versions.
Agent Prompt
Issue description
Snap versions must remain unprefixed when the component range configuration is `~`; this configuration is supported and has a distinct input branch from the surviving `^` scenario.

Fix Focus Areas
- e2e/harmony/dependency-resolver.e2e.ts[643-676]

Recommended Fix
Restore a `componentRangePrefix: '~'` snap scenario that asserts both dependency resolver data and the generated package manifest omit `~` from hash-version dependencies, alongside the existing caret-prefix coverage.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines -437 to +439
const output = helper.command.mergeLane('dev', '--build --no-squash');
expect(output).to.have.string('Total Snapped: 0');
});
it('should succeed despite test failures', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

20. Failed merges can create snaps unnoticed 🐞 Bug ≡ Correctness

The PR deletes the non---loose mergeLane('dev', '--build --no-squash') assertion that a failing
Jest task reports Total Snapped: 0. The surviving scenario invokes only --build --loose, while
the cited replacement injects a missing dependency and checks only .bitmap, so a tester failure
that incorrectly creates a merge snap is no longer detected.
Agent Prompt
Issue description
The non-loose `--build` merge path no longer verifies that a failing Jest task prevents creation of a merge snap. The retained `--loose` case proves the opposite behavior and the purported sibling replacement uses a different failure mechanism.

Fix Focus Areas
- e2e/harmony/lanes/merge-lanes-edge-cases-2.e2e.ts[414-443]
- e2e/harmony/lanes/merge-lanes-edge-cases.e2e.ts[40-58]

Recommended Fix
Add back a non-`--loose` merge execution using the existing failing-Jest setup and assert that it reports zero snaps (and, preferably, leaves the component head unchanged). Keep the `--loose` run isolated through a workspace clone so both flag behaviors execute from identical histories.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

describe('creating a new lane without any component', () => {
let output;
before(() => {
helper.scopeHelper.reInitWorkspace({ addRemoteScopeAsDefaultScope: false });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

23. Lanes without remote defaults go untested 🐞 Bug ⚙ Maintainability

Changing reInitWorkspace({ addRemoteScopeAsDefaultScope: false }) to reInitWorkspace() replaces
the local-default lane-creation case with the standard remote-default case. Lane creation derives
its tracking scope from workspace.defaultScope, so the suite no longer verifies that an empty lane
is correctly created and displayed when that scope remains the workspace's local my-scope value.
Agent Prompt
## Issue description
Preserve a lane-creation test for workspaces whose default scope is not switched to the configured remote scope. This setup exercises a distinct tracking-scope resolution path from the standard remote-default setup.

## Fix Focus Areas
- e2e/harmony/lanes/lane-basic-operations.e2e.ts[19-32]

## Recommended Fix
Add a separate scenario that calls `reInitWorkspace({ addRemoteScopeAsDefaultScope: false })`, creates a lane without an explicit `--scope`, and asserts that the active lane and its tracking data use `my-scope/dev`. Keep the consolidated remote-default scenario for default remote tracking behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

expect(peerDep.version).to.eq(head);
expect(peerDep.versionRange).to.eq('0');
});
it('adds peer dependency to the generated package.json', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

18. Existing components can omit peer manifests 🐞 Bug ≡ Correctness

The existing-component scenario snaps both components before calling setPeer('comp2', '0'), but
its only generated capsule package.json assertion was removed. The remaining test validates model
references to the pre-existing head, so a build that persists that model data but omits or miswrites
the peer dependency in the capsule manifest is no longer detected.
Agent Prompt
## Issue description
Restore the generated capsule package assertion for setting a peer dependency after the components already have snaps.

## Fix Focus Areas
- e2e/functionalities/peer-dependency-component.e2e.ts[187-222]

## Recommended Fix
Capture the capsule root after the build in the existing-component scenario, read comp1's versioned capsule `package.json`, and assert that its `peerDependencies` contains comp2 with range `0`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

});
describe('import with --path flag', () => {
before(() => {
helper.scopeHelper.reInitWorkspace();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

19. Package imports can ignore custom paths 🐞 Bug ⚙ Maintainability

The deleted import with --path flag scenario ran importComponentWithOptions() after a fresh
workspace was configured with the custom resolver, while the new assertion runs only against a
workspace with its remote explicitly added. When imports are resolved through that resolver for
TypeScript components, no remaining test combines that route with --path, so regressions in its
destination-directory or bitmap update behavior are not detected.
Agent Prompt
Issue description
The replacement `--path` test covers a locally configured remote, but the removed test was the only one that used `--path` after `NpmCiRegistry.setResolver()` in the TypeScript-component flow.

Fix Focus Areas
- e2e/harmony/import-harmony.e2e.ts[17-25]
- e2e/harmony/import-harmony.e2e.ts[57-72]
- e2e/harmony/import-harmony.e2e.ts[317-322]

Recommended Fix
Retain or add a compact test in the resolver-backed TypeScript import flow that imports `comp1` with `-p src` and asserts both that `src` exists and that the bitmap entry has `rootDir: 'src'`. The local-remote test may remain as shared coverage, but it should not replace this distinct resolution route.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


helper.scopeHelper.reInitWorkspace();
helper.scopeHelper.addRemoteScope();
helper.command.importLane('lane-b');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

21. Remote merges can lose new files unnoticed 🐞 Bug ≡ Correctness

The deleted diverged-lane test was the only one that added comp1/new-file.ts on an exported source
lane, reinitialized the workspace, imported the target lane, and merged the source through its
remote lane ID. The remaining new-file test merges a locally available lane, and the remaining
remote merge only validates pre-existing component files, so remote object transfer and
materialization of lane-only files no longer have an end-to-end assertion.
Agent Prompt
Issue description
The remote merge path no longer verifies that a file introduced only by a divergent exported lane is fetched and written after the destination lane is imported into a fresh workspace. Local merge coverage does not exercise the remote lane transport path.

Fix Focus Areas
- e2e/harmony/lanes/merge-lanes-diverge.e2e.ts[108-132]
- e2e/harmony/lanes/diverged-from-forked.e2e.ts[23-63]
- e2e/harmony/lanes/merge-lanes-remote.e2e.ts[29-42]

Recommended Fix
Restore a focused scenario that creates and exports a lane-only file, reinitializes the workspace, imports the target lane, merges the source using its remote lane ID, and asserts that the new file exists. It can share setup with another remote merge case, but must retain the fresh-workspace remote merge step.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


helper.scopeHelper.getClonedWorkspace(originalWs);
});
it('checkout head should stop with an error', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

22. Pending merges can update other files 🐞 Bug ≡ Correctness

Deleting the active pending-merge scenario removes the only assertion that checkoutHead('-x')
leaves an unrelated component's working-tree content unchanged after rejecting the checkout. The
surviving scenario checks only bitmap versions after a different two-component setup, so a partial
checkout that writes another component before detecting a merge-pending component is no longer
caught.
Agent Prompt
## Issue description
Restore coverage for `bit checkout head` in a workspace containing both a merge-pending component and a separately advanced component. The command must fail without materializing the other component's newer remote content.

## Fix Focus Areas
- e2e/harmony/lanes/bit-checkout-on-lanes.e2e.ts[78-115]

## Recommended Fix
Reintroduce the deleted cross-workspace pending-merge setup, or add an equivalent scenario. Advance a non-pending component in another workspace, run `checkoutHead('-x')` from the workspace with the pending merge, assert it throws, and assert that component's file still has its pre-checkout content.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

expect(result).to.include('found 2 components');
});

it('should support exclusion patterns from remote', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

3. Remote pattern exclusions can regress unnoticed 🐞 Bug ⚙ Maintainability

The deleted remote tests are the only ones that invoke bit pattern --remote with negated exact and
wildcard patterns. Remote matching first excludes negations while selecting remote scopes and only
then applies them to the fetched ID pool, whereas the surviving negation tests use the separate
local workspace path.
Agent Prompt
## Issue description
Remote exclusion patterns have a distinct fetch-then-filter implementation path and are no longer exercised by an end-to-end test.

## Fix Focus Areas
- e2e/commands/pattern.e2e.ts[175-187]

## Recommended Fix
Restore an active `--remote` test that includes a positive scoped pattern plus an exact negated pattern, and retain or add a wildcard-negation case. Assert that excluded remote IDs are absent and the expected remaining IDs/count are returned.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

);
expect(output).to.have.string('positive integer');
});
it('should error when --dependencies-depth is a fractional number', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

4. Fractional depth validation loses coverage 🐞 Bug ⚙ Maintainability

The consolidated validation test retains zero and nonnumeric values but deletes the 1.5 invocation
of --dependencies-depth. The command converts the supplied string with Number() and rejects it
through Number.isInteger(), so a regression accepting fractional numeric values is not exercised
by the surviving cases.
Agent Prompt
## Issue description
The validation suite no longer verifies rejection of a numeric fractional dependency depth.

## Fix Focus Areas
- e2e/commands/import.e2e.ts[483-493]

## Recommended Fix
Add `--dependencies-depth 1.5` to the consolidated positive-integer validation test and assert that its output contains `positive integer`, alongside the zero and nonnumeric cases.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread e2e/flows/sort-components-output.e2e.ts
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit d24db40

davidfirst and others added 2 commits September 10, 2026 11:59
resolvePackageNameByPath is pure, so the whole e2e file is replaced by cases in
resolve-pkg-name-by-path.spec.ts, which also covers previously untested branches.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment on lines -88 to 91
it('should save "chai" in the dev-packages', () => {
expect(comp1.devPackageDependencies).to.be.an('object').that.has.property('chai');
});
it('should not save "chai" in the packages', () => {
expect(comp1.packageDependencies).to.be.an('object').that.is.empty;
});
it('should not save anything into dependencies', () => {
expect(comp1.dependencies).to.be.an('array').that.is.empty;
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

16. Dev packages can be misclassified 🐞 Bug ≡ Correctness

The consolidated dev-dependency scenario removes assertions that chai appears in
devPackageDependencies and not in packageDependencies. Its remaining checks cover component
dependency arrays only, so package imports from test files can enter the regular-package bucket
without failing this suite.
Agent Prompt
## Issue description
The surviving test no longer verifies that an npm package imported exclusively by a test file is classified as a development package rather than a regular package.

## Fix Focus Areas
- e2e/functionalities/dev-dependencies.e2e.ts[76-94]
- scopes/dependencies/dependencies/dependencies-loader/auto-detect-deps.ts[475-493]

## Recommended Fix
Add both classification assertions to the consolidated test: require `chai` in `devPackageDependencies` and require it to be absent from `packageDependencies`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines -154 to 157
it('adds peer dependency to the generated package.json', () => {
const pkgJson = fs.readJsonSync(
path.join(workspaceCapsulesRootDir, `${helper.scopes.remote}_comp1/package.json`)
);
expect(pkgJson.peerDependencies).to.deep.equal({
[`@${helper.scopes.remote}/comp2`]: '^0.0.1-new',
});
});
describe('peer dependency is not broken after snap', () => {
before(() => {
helper.command.snapAllComponents();
helper.command.build();
workspaceCapsulesRootDir = helper.command.capsuleListParsed().workspaceCapsulesRootDir;
});
it('should save the peer dependency in the model', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

17. Peer manifests can omit dependencies 🐞 Bug ≡ Correctness

The deleted capsule assertions were the only checks that component peer dependencies are emitted
into generated package.json files. The surviving model assertions bypass manifest conversion, so
capsules can retain correct scope metadata while exposing an incorrect or missing peer dependency to
package consumers.
Agent Prompt
## Issue description
Model-level peer dependency assertions do not verify the separate conversion into generated capsule package manifests.

## Fix Focus Areas
- e2e/functionalities/peer-dependency-component.e2e.ts[127-161]
- scopes/dependencies/dependency-resolver/dependencies/dependency-list.ts[155-176]

## Recommended Fix
Keep one focused assertion that builds a capsule, reads its generated package.json, and verifies the component dependency appears under peerDependencies with the expected range.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment on lines 208 to 211
@@ -227,12 +211,10 @@ describe('compile extension', function () {
helper.command.setEnv('comp1', EMPTY_ENV);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

19. Multiple directory compilation loses coverage 🐞 Bug ☼ Reliability

The removed compile case is the only scenario that supplies two component root-directory paths in
one command invocation. The retained mixed-input test combines one directory with an ID instead,
leaving multi-directory parsing and component selection unverified.
Agent Prompt
Issue description
Compilation with multiple root-directory arguments is no longer tested, although it is a distinct command-input form from a directory plus component ID.

Fix Focus Areas
- e2e/harmony/compile.e2e.ts[185-204]

Recommended Fix
Restore a test that invokes compile with `nested/comp1 nested/comp2` and asserts both components are selected and compiled.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread e2e/commands/add.e2e.ts
helper.fs.createFile('bar', file1);
helper.fs.createFile('bar', file2);

const addCmd = () => helper.command.addComponent('bar', { n: 'test' });

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

15. Adding unresolved components goes untested 🐞 Bug ≡ Correctness

The deleted bit add scenario was the only integration test for automatic main-file resolution
exhausting every strategy and throwing MissingMainFile. The new unit suite checks a missing
user-specified file but not the default unresolved case or its propagation through the add command.
Agent Prompt
## Issue description
The replacement unit suite does not cover failure after automatic main-file resolution exhausts every strategy, and no command test now verifies that error propagation.

## Fix Focus Areas
- scopes/component/tracker/determine-main-file.spec.ts[108-115]
- e2e/commands/add.e2e.ts[72-82]

## Recommended Fix
Add a unit case with multiple files, no explicit main file, and no recognized index or directory-named file, asserting `MissingMainFile`. Retain a focused command-level assertion if propagation through `bit add` is not covered elsewhere.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Comment thread e2e/commands/init.e2e.ts
expect(output).to.have.string('initialized a bit workspace');
});

it('should skip interactive mode with --external-package-manager flag', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

18. Flagged initialization can still prompt 🐞 Bug ☼ Reliability

The deleted initialization cases were the only tests proving that external-package-manager,
standalone, and reset modes bypass runInteractiveMode(). These flags reach an explicit
short-circuit in the command, and a regression there can make scripted initialization wait for
interactive input.
Agent Prompt
## Issue description
Initialization flags intended for scripted operation no longer have coverage proving that they bypass the interactive setup path.

## Fix Focus Areas
- e2e/commands/init.e2e.ts[510-527]
- scopes/harmony/host-initializer/init-cmd.ts[76-125]

## Recommended Fix
Retain a parameterized test for the external-package-manager, standalone, and reset options. Assert that each invocation completes successfully without emitting or entering interactive setup.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

expect(componentFileLocation).to.be.a.file();
});
});
describe('when the destination is an existing empty directory', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Custom-path imports lose coverage 🐞 Bug ☼ Reliability

The deleted bit import --path destination suite was the only command-level coverage for successful
writes to an empty directory, rejection and content preservation for a non-empty directory,
overwrite behavior with --override, and rejection when the target is an existing file. These cases
reach separate component-writer conflict branches from the surviving non-existent-destination test,
so regressions in destination handling and safeguards against overwriting user files no longer fail
an integration test.
Agent Prompt
## Issue description
The `bit import --path` destination scenarios were removed even though empty directories, occupied directories, existing file targets, and override behavior follow distinct component-writer paths. Command-level coverage should verify both successful destination handling and safeguards that preserve existing user content.

## Fix Focus Areas
- e2e/commands/import.e2e.ts[160-223]
- scopes/component/component-writer/component-writer.main.runtime.ts[333-358]

## Recommended Fix
Restore focused destination tests that verify import into an empty directory, rejection of a non-empty destination without deleting or changing its existing content, successful replacement of a directory with `--override`, and rejection when the destination is a file both with and without `--override`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

// Note: getClonedWorkspace destroys the current dir and restores from the snapshot,
// so each runAsFirstCommand call starts fresh from the same pre-CI state.

it('`bit status` as first command syncs bitmap', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

20. Status no longer checks automatic sync 🐞 Bug ☼ Reliability

The PR deletes the first-command scenario that invokes helper.command.status() after the CI merge.
The retained first-command tests cover list, show, log, and compile, so a status-specific failure to
trigger bitmap synchronization is no longer detected.
Agent Prompt
Issue description
The suite no longer verifies that status triggers bitmap synchronization when it is the first Bit command after the CI merge.

Fix Focus Areas
- e2e/harmony/ci-bitmap-auto-sync.e2e.ts[340-372]

Recommended Fix
Restore the first-command status test using `runAsFirstCommand(() => helper.command.status())` and assert the bitmap records version `0.0.2`.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

helper.scopeHelper.addRemoteScope();
helper.command.importLane('dev');

helper.fs.outputFile(`${helper.scopes.remote}/comp3/index.js`, 'console.log("v2");');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

21. Pending merges can update other components 🐞 Bug ☼ Reliability

The deleted pending-merge scenario uniquely creates a pending merge through a main-to-lane merge and
then publishes a changed unrelated component from another workspace before calling checkout. The
retained test only compares component heads after a different import-based setup, so it no longer
verifies that checkout leaves an unrelated component's files untouched when it aborts.
Agent Prompt
Issue description
Checkout failure with a pending merge is no longer tested when another component has a newly published remote file revision.

Fix Focus Areas
- e2e/harmony/lanes/bit-checkout-on-lanes.e2e.ts[78-115]
- e2e/harmony/lanes/bit-checkout-on-lanes.e2e.ts[15-45]

Recommended Fix
Restore the scenario that creates a pending merge for one component, exports a changed unrelated component from a second workspace, runs checkout, and asserts the unrelated workspace file was not updated.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

});
describe('rename lane using the alias', () => {
before(() => {
helper.scopeHelper.setWorkspaceWithRemoteScope();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

22. Aliased lane renames lose coverage 🐞 Bug ☼ Reliability

The deleted test creates and exports a lane with --alias before renaming it, whereas the purported
replacement creates an ordinary lane. Alias creation is otherwise only exercised when switching to
remote lanes, so a rename regression involving alias-backed lane state is no longer covered.
Agent Prompt
Issue description
Renaming an exported lane created with an alias is no longer tested; the retained exported-lane test does not use an alias.

Fix Focus Areas
- e2e/harmony/lanes/rename-lane.e2e.ts[16-33]
- e2e/harmony/lanes/lane-management.e2e.ts[18-52]

Recommended Fix
Restore the aliased-lane scenario: create `dev` with `--alias d`, snap and export it, rename it, then assert status succeeds and `.bitmap` contains the new lane name.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit a244936


helper.scopeHelper.getClonedWorkspace(originalWs);
});
it('checkout head should stop with an error', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

14. Forced checkout can update unrelated components 🐞 Bug ☼ Reliability

The deleted pending-merge scenario was the only one to call checkoutHead('-x') after a
merge-pending component was created and to verify that another component did not advance. The
surviving pending-merge setup invokes checkoutHead() without the force flag, while its only forced
checkout scenario has no merge-pending component, so the force-specific safeguard is no longer
exercised.
Agent Prompt
Issue description
The forced `checkoutHead('-x')` path is no longer tested when a workspace contains a merge-pending component. Preserve the assertion that the command fails and does not advance an unrelated component.

Fix Focus Areas
- e2e/harmony/lanes/bit-checkout-on-lanes.e2e.ts[78-115]

Recommended Fix
Restore the deleted pending-merge setup and assertions, or add an equivalent isolated scenario that invokes `checkoutHead('-x')`, expects the merge-pending failure, and verifies that the unrelated component remains at its original revision.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

helper.fs.deletePath('comp1/foo.js');
helper.command.snapAllComponentsWithoutBuild();
helper.command.export();
helper.command.switchLocalLane('main', '-x');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

15. Fast-forward merges can retain deleted files 🐞 Bug ≡ Correctness

The PR deletes the only scenario in merge-lanes-edge-cases.e2e.ts that merges a lane containing a
file deletion into unchanged main, which exercises direct remote-component application without
three-way results. Because the retained scenario creates a new main tag before merging, it covers
only the diverged three-way path, allowing obsolete workspace files left by fast-forward merges to
escape the suite.
Agent Prompt
## Issue description
The cleanup removes the only integration scenario verifying that a fast-forward lane merge deletes files removed on the source lane. The retained scenario deliberately diverges main before merging and therefore exercises the separate three-way merge path, which cannot cover regressions in direct remote-component application.

## Fix Focus Areas
- e2e/harmony/lanes/merge-lanes-edge-cases.e2e.ts[379-405]

## Recommended Fix
Restore an isolated non-diverged integration scenario: leave main at the common base, remove and snap the file on the source lane, switch to unchanged main, merge the lane, and verify both the removal status in the command output and the file's absence from the workspace.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

});
});

describe('when no components in workspace', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

16. Empty workspace searches can misreport results 🐞 Bug ≡ Correctness

The deleted when no components in workspace block was the only command test that reinitialized an
empty workspace before invoking local-only search. All surviving search cases populate and tag
components first, even though SearchCmd.report() has a dedicated zero-local-results rendering
branch for workspaces.
Agent Prompt
Issue description
The suite no longer executes `bit search --local-only` in an empty workspace. Preserve a test for the empty-workspace local output path.

Fix Focus Areas
- e2e/commands/search.e2e.ts[73-80]

Recommended Fix
Add a separate describe that reinitializes an empty workspace, runs `bit search anything --local-only`, and asserts that the local no-match message is rendered.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

const statusOutput = helper.command.runCmd('bit status');
expect(statusOutput).to.have.string('modified components');
});
it('should update bitmap with the imported version', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

17. Manual merges can retain the old version 🐞 Bug ≡ Correctness

The PR removes the bitmap-version assertion from the manual conflict merge branch, leaving that
branch checked only for conflict markers and modified status. A manual merge can therefore leave
comp2 recorded at its prior revision while still satisfying every remaining assertion in that
branch.
Agent Prompt
Issue description
The manual merge scenario no longer verifies that importing revision `0.0.2` updates the component revision stored in the bitmap. Keep this bookkeeping assertion alongside the conflict-content checks.

Fix Focus Areas
- e2e/functionalities/merge.e2e.ts[111-114]

Recommended Fix
After the manual merge completes, read the bitmap and assert that `comp2.version` equals the imported version. Keep the assertion specific to the manual conflict strategy.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

expect(peerDep.version).to.eq('latest');
expect(peerDep.versionRange).to.eq('^0.0.1-new');
});
it('adds peer dependency to the generated package.json', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Remediation recommended

18. Built packages can omit peer dependencies 🐞 Bug ≡ Correctness

The PR deletes the capsule package.json assertions after setPeer('comp2', '^') and after the
subsequent snap, leaving only model and scope metadata checks. Capsule manifest generation
separately maps dependency lifecycle entries into peerDependencies, so persistence of the model
data does not establish that the generated package contains the required peer range.
Agent Prompt
Issue description
The `set-peer` scenarios no longer verify the peer dependency emitted into the generated capsule package manifest. Retain checks before and after snapping so model metadata and generated package output stay aligned.

Fix Focus Areas
- e2e/functionalities/peer-dependency-component.e2e.ts[154-161]
- e2e/functionalities/peer-dependency-component.e2e.ts[194-202]

Recommended Fix
Read the relevant workspace capsule `package.json` after each build and assert that `peerDependencies` contains the component package with the expected range.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 1f81463

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