A lightweight, standalone Visual Studio Code extension for running Apex tests and inspecting org-wide and class-level code coverage through Salesforce CLI. It does not require the Salesforce Extension Pack.
Actions are available from view toolbars, row menus, and the Command Palette where applicable.
Run or rerun Apex test classes.
Pin or unpin classes in the Apex Tests and Code Coverage views.
Find classes, refresh extension data, and clear recent test runs.
Clear code coverage data from the selected org.
Privacy
Salesforce Tests does not add telemetry. Commands and data stay between VS Code, the local Salesforce CLI, and the authenticated Salesforce org.
Troubleshooting
The extension is unavailable in Restricted Mode: Trust the workspace because Salesforce Tests runs local Salesforce CLI commands.
sf is not found: Run sf --version in VS Code's integrated terminal. Install the CLI in the same local or remote environment if it fails.
No default org appears: Run sf org list, set one with sf config set target-org <alias-or-username>, then refresh the org in the extension.
Authentication has expired: Authenticate the org again with sf org login web, then refresh the org.
Classes or coverage are missing: Confirm that the authenticated user can access Apex classes, test results, and code coverage through the Tooling API. Managed-package classes are not listed.
The wrong or stale org is shown: Use Salesforce Tests: Refresh Org after changing the Salesforce CLI default org.
A test or coverage operation fails: Open View → Output, select Salesforce Tests, and inspect the Salesforce CLI error.