Skip to content

test: add installExtensions mock coverage#52

Merged
chahe-dridi merged 2 commits intochahe-dridi:mainfrom
terminalchai:test-install-extensions-mock
Apr 2, 2026
Merged

test: add installExtensions mock coverage#52
chahe-dridi merged 2 commits intochahe-dridi:mainfrom
terminalchai:test-install-extensions-mock

Conversation

@terminalchai
Copy link
Copy Markdown
Contributor

Summary

  • add mocked tests for installExtensions() without calling the real code CLI
  • cover all-success, all-fail, and mixed-result flows
  • verify onProgress is called once per extension and results length matches input length

Validation

  • npm test
  • npm run lint

Closes #25

@chahe-dridi
Copy link
Copy Markdown
Owner

Hey @terminalchai — the conflict is small, only 3 spots.
Here is exactly what to keep in each one:

Conflict 1 — keep the main version (with the checkmark):
console.log(" ✓ generateExtensionsJson - creates valid .vscode/extensions.json");

Conflict 2 — keep the main version (with the checkmark):
console.log(" ✓ generateExtensionsJson - auto-creates .vscode directory");

Conflict 3 — keep the main version (the one with two assert.ok checks):
assert.ok(
instructions.includes("Add to PATH"),
"Windows instructions should mention adding VS Code to PATH"
);
assert.ok(
instructions.includes("restart your terminal"),
"Windows instructions should tell the user to restart the terminal"
);
console.log( ✓ getCodeInstallInstructions - returns: "${instructions.slice(0, 50)}...");

In each conflict block, delete everything from <<<<<<< to >>>>>>>
and replace it with the lines above. Your mock tests below are
untouched and perfect as-is.

Click "Resolve conflicts" on the PR page, make those 3 swaps,
click "Mark as resolved" then "Commit merge" and I will merge
right away! 🙌

@chahe-dridi chahe-dridi merged commit 9929a79 into chahe-dridi:main Apr 2, 2026
3 checks passed
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.

[TESTS] Write tests for installExtensions() with a mock

2 participants