Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>JSAutotestNew to Visual Studio Code? Get it now.
JSAutotest

JSAutotest

SirPedr

|
75 installs
| (0) | Free
Running test for files made easy
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

JS Autotest

Running tests for your files made easy. This extension allows you to run your test command on one or more files with only 2 clicks, without having to copy the file paths every time or running all your tests at once.

Add to VSCode: https://marketplace.visualstudio.com/items?itemName=SirPedr.js-autotest

Table of Contents

  • Features
    • Supported files
    • Supported test runners
    • Running test command for a file
    • Running test command for multiple files
      • Adding a file to the test group
      • Removing a file from the test group
      • Running all tests for files in the test group
  • Requirement
  • Extension Settings

Features

Supported files

JS Autotest has built-in support for JS, TS, JSX and TSX files.

Supported test runners

At this time, JSAutotest supports Jest.

Running test command for a file

Tip: You can also run this and any command that is executed through the context menu on non-test files. In this case, Autotest will try to find the correspondent test file according to your autotest.testFilePattern configuration.

Right-click any of the supported files, then select the option Run tests for this file. Autotest will then run your test script passing the file path as an argument to that script.

Be aware that JSAutotest will create a new terminal named 'Autotest' to run the command. If a terminal with the same name already, exists, JSAutotest will use it instead.

Example

Running test command for multiple files

You can run tests for multiple files at once adding them to what we call a 'test group'. A test group is a list of paths to your test files.

Adding a file to the test group

Right-click any of the supported files then select the option Add to test group. You should receive a success message if the operation ran without errors. Note that you can't add the same file to the test group more than once.

Example

Removing a file from the test group

Right-click any of the supported files then select the option Remove from test group. If the file was in the test group, it will be removed and you should see a confirmation message.

Example

Running all tests for files in the test group

Open the command palette (Ctrl + Shift + P on Windows/Linux, Command + Shift + P on Mac) then type Run tests for test group. All tests included in the test group will run at once.

This command follows the same terminal rules explained in Running test command for a file section.

Example

Requirements

In order to use this extension you need VSCode 1.73.0 or above.

Extension Settings

This extension contributes the following settings:

  • autotest.packageManager (default: npm): Which package manager are you using in your project, like yarn or npm.

  • autotest.testRunnerScriptName (default: test): The name of the script thar runs your tests.

  • autottest.tesFilePattern (default: [name].test.{js,jsx,ts,tsx}): This is a glob that indicates the pattern name for your test files based on the implementation file nime.

    • You can use the [name] variable in the pattern to indicate where the original file name is placed.
    • You can use any pattern that the glob package can read and parse.
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft