Skip to content

Building & Testing

CommandDescription
npm run buildCompile TypeScript to build/
npm run watchDevelopment mode — auto-rebuild on file changes
npm run ltfLint → Typecheck → Format (recommended before committing)
npm run ltfbLint → Typecheck → Format → Build (full pipeline)
node build/index.jsTest that the server starts correctly

Run npm run ltfb before any commit to ensure linting, type checking, formatting, and the build all pass.

Run the full test suite:

Terminal window
npm test

Run with coverage report:

Terminal window
jest --coverage
MetricValue
Unit tests168 tests across 12 suites
Statement coverage92.2%
Handler modules testedAll 8 (repository, pullrequest, commit, diff, issue, pipeline, search, workspace)
Core modules testedapi, config, errors
  • All 8 handler modules with mocked makeRequest / makeTextRequest calls
  • Output format conversion: text, json, toon
  • JMESPath filtering with edge cases
  • Error handling and custom error messages
  • Configuration management

Unit tests live in src/__tests__/handlers/ — follow existing patterns when adding new tests.

The server includes integration tests that verify tools against the real Bitbucket API.

MetricValue
Tools verified31 of 37 (100% success rate on testable tools)
ApproachDiscovery-based — extracts real IDs from API responses dynamically

To run integration tests, the server must be able to authenticate against Bitbucket. Credentials are loaded from .vscode/mcp.json.

  1. Follow handler test patterns in src/__tests__/handlers/
  2. Mock API calls using jest.mock for unit tests
  3. For integration tests, load credentials from .vscode/mcp.json
  4. Validate both successful responses and error conditions

For development within VS Code:

  • Install the GitHub Copilot extension
  • Use the provided .vscode/ configuration in the repo
  • Open Copilot Chat with Ctrl+Alt+I
  • Test with: using bitbucket, list repositories in myworkspace