A multi-language testing extension for Visual Studio Code that supports Java (Maven/JUnit), Angular (Jasmine/Karma), and Python (unittest).
-
Multi-Language Support: Automatically detects workspace type and runs appropriate tests
- Java: Maven + JUnit
- Angular: Jasmine + Karma
- Python: unittest
-
Unified Test Interface: Consistent webview UI across all language types
-
Detailed Test Results: View test outcomes with:
- Pass/Fail/Skip status
- Test duration
- Failure messages
- Expected vs Actual values for failed assertions
-
Sidebar Integration: Easy access via dedicated Activity Bar icon
-
Create a
.lab.jsonfile in your workspace root with the following content:{ "workspaceType": "Java" }Valid values for
workspaceType:"Java"- For Java/Maven projects with JUnit tests"Angular"- For Angular projects with Jasmine/Karma tests"Python"- For Python projects with unittest tests
Note: If
.lab.jsonis not found or invalid, the extension will default to Python and display a warning. -
(Optional) Set environment variables for telemetry:
-
TELEMETRY_AI_KEY: Application Insights instrumentation key- Windows:
set TELEMETRY_AI_KEY=your-key-here - Linux/Mac:
export TELEMETRY_AI_KEY=your-key-here
- Windows:
-
TELEMETRY_ENDPOINT: Custom telemetry endpoint URL (defaults to Azure Application Insights)- Windows:
set TELEMETRY_ENDPOINT=https://your-endpoint.com/v2/track - Linux/Mac:
export TELEMETRY_ENDPOINT=https://your-endpoint.com/v2/track
- Windows:
-
-
Open your project in VS Code
-
Click on the Cloud IDE Test icon in the Activity Bar (left sidebar)
- Open the test view from the sidebar
- Click the "Run Tests" button
- View results in the webview panel
- Maven installed and available in PATH
- JUnit tests configured in pom.xml
- Node.js and npm installed
- Jasmine/Karma configured
testscript in package.json
- Python 3 installed and available in PATH as
python3 - Test files must be located in
src/testfolder - Test files must contain "test" in the filename (e.g.,
test_example.py,example_test.py,my_tests.py) - Tests following unittest conventions (built-in, no additional dependencies)
- Optional: pytest (will be used as fallback if unittest is not available)
This extension uses a combination of configuration file and environment variables:
Place a .lab.json file in your workspace root with the following structure:
{
"workspaceType": "Java"
}- workspaceType (optional, defaults to
Python): Determines which test framework to use- Valid values:
"Java","Angular", or"Python"
- Valid values:
- TELEMETRY_AI_KEY (optional): Azure Application Insights instrumentation key for telemetry
- TELEMETRY_ENDPOINT (optional): Custom telemetry endpoint URL
The extension will activate successfully even if .lab.json is not found. It will default to Python and display a warning message in the webview.
To run this extension in development mode:
- Install dependencies:
npm install - Open in VS Code
- Press F5 to open a new window with the extension loaded
- In the test project, create a
.lab.jsonfile with your desired workspace type - Open a test project and try the extension
To build the extension:
npm install
npm run compileTo package the extension:
npm install -g @vscode/vsce
vsce packageMIT