Skip to main content

Unit tests

Testing Framework

We chose Jest as the testing framework because it works well with our TypeScript and JavaScript codebase, is easy to set up, and has built-in support for mocking and stubbing.

Key Features

Mocking: Can fake modules and VS Code APIs so tests run on their own.

Auto Test Discovery: Finds and runs all test files automatically.

Assertions: Check results, function calls, and objects easily.

Code Coverage: Shows what parts of the code are tested.

Async Support: Works with async/await for things like team creation.

Test Isolation: Resets mocks and sets up fresh instances before each test.

Suitability

Handles complex dependencies like VS Code APIs.

Supports async operations without extra setup.

Works well with TypeScript using ts-jest.

Good for VS Code extension testing (webviews, commands, extension lifecycle).

Easy to use in CI/CD pipelines.

Running Frontend Testing

To run all frontend (extension) test cases:

  1. Navigate to the extension folder:
cd extension
  1. Run the test command:
npm run test

This will run all Jest test suites for the VS Code extension, including:

  • Extension tests (25 test suites)
  • 343+ unit tests covering services, API calls, and components

Running Backend Testing

To run all backend (server) test cases:

  1. Navigate to the server folder:
cd server
  1. Run the pytest command:
python -m pytest

This will run all pytest test suites for the Flask backend, including:

  • API route tests
  • Database tests
  • Authentication tests
  • 86+ unit tests covering all backend functionality

Frontend Coverage Summary

Test Coverage Report

This coverage report is automatically generated on every pull request against main with passing tests in our GitHub Actions CI/CD Pipeline.

Overall Coverage Summary

MetricCoverage
Statements57.91%
Branches63.44%
Functions67.15%
Lines57.91%

Coverage Details

The detailed coverage report shows which parts of the code are tested and which need more test coverage. This helps ensure code quality and reliability.

Note: This report updates automatically when CI runs tests with coverage.

View Detailed Frontend Coverage Report