Socket
Book a DemoInstallSign in
Socket

vscode-customized-jest-runner

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vscode-customized-jest-runner

Simple way to run or debug a single (or multiple) tests from context-menu

latest
Source
npmnpm
Version
0.5.55
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

vscode-customized-jest-runner

A customized version of vscode-jest-runner.

configs

Change Configs as below

Supports

  • yarn & vscode workspaces (monorepo)
  • dynamic jest config resolution
  • yarn 2 pnp
  • CRA & and similar abstractions

Extension Example

Extension Settings

Jest Runner will work out of the box, with a valid Jest config.
If you have a custom setup use the following options to configure Jest Runner:

CommandDescription
jestrunner.configPathJest config path (relative to ${workFolder} e.g. jest-config.json)
jestrunner.jestPathAbsolute path to jest bin file (e.g. /usr/lib/node_modules/jest/bin/jest.js)
jestrunner.debugOptionsAdd or overwrite vscode debug configurations (only in debug mode) (e.g. "jestrunner.debugOptions": { "args": ["--no-cache"] })
jestrunner.runOptionsAdd CLI Options to the Jest Command (e.g. "jestrunner.runOptions": ["--coverage", "--colors"]) https://jestjs.io/docs/en/cli
jestrunner.jestCommandDefine an alternative Jest command (e.g. for Create React App and similar abstractions)
jestrunner.disableCodeLensDisable CodeLens feature
jestrunner.codeLensSelectorCodeLens will be shown on files matching this pattern (default */.{test,spec}.{js,jsx,ts,tsx})
jestrunner.codeLensChoose which CodeLens to enable, default to ["run", "debug"]
jestrunner.enableYarnPnpSupport Enable if you are using Yarn 2 with Plug'n'Play
jestrunner.yarnPnpCommandCommand for debugging with Plug'n'Play defaults to yarn-*.*js
jestrunner.projectPathAbsolute path to project directory (e.g. /home/me/project/sub-folder)
jestrunner.changeDirectoryToWorkspaceRootChanges directory to workspace root before executing the test
jestrunner.preserveEditorFocusPreserve focus on your editor instead of focusing the terminal on test run

Shortcuts

click File -> Preferences -> Keyboard Shortcuts -> "{}" (top right) the json config file will open add this:

{
  "key": "alt+1",
  "command": "extension.runJest"
},
{
  "key": "alt+2",
  "command": "extension.debugJest"
},
{
  "key": "alt+3",
  "command": "extension.watchJest"
},

Want to start contributing features?

Some open topics get you started

Steps to run in development mode

  • npm install
  • Go to Menu "Run" => "Start Debugging"

Another vscode instance will open with the just compiled extension installed.

Notes from contributors

"jestrunner.debugOptions": {
    "args": ["--no-cache"],
    "sourcemaps": "inline",
    "disableOptimisticBPs": true,
}

FAQs

Package last updated on 08 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts