Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>Salesforce TestsNew to Visual Studio Code? Get it now.
Salesforce Tests

Salesforce Tests

Fernando Martinez

|
706 installs
| (1) | Free
Run Apex tests and inspect org-wide and class-level code coverage from VS Code using Salesforce CLI.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Salesforce Tests

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.

Version License: MIT

Install Salesforce Tests from the Visual Studio Marketplace

Preview

Salesforce Tests running an Apex test and updating code coverage in VS Code

Features

  • Run Apex tests: Browse unmanaged Apex test classes and run them directly from the sidebar.
  • Track test results: Follow execution states and timings, then rerun recent tests when needed.
  • Inspect code coverage: Review org-wide and class-level coverage, including covered and total lines.
  • Stay lightweight: Use your existing Salesforce CLI authentication and org configuration. The Salesforce Extension Pack is not required.

Requirements

  1. Visual Studio Code 1.100.0 or later.
  2. Salesforce CLI available as sf in the environment's PATH.
  3. An authenticated default Salesforce org.

Installation

Install the extension from the Visual Studio Marketplace, or use the VS Code command-line interface:

code --install-extension femartinezg.salesforce-tests

Actions

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.

Resources

  • Visual Studio Marketplace
  • Changelog
  • Report an issue

Author

Fernando Martinez

License

Salesforce Tests is available under the MIT License.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft