NodeJS Run Configuration Producer for IntelliJ Platform (IntelliJ IDEA, WebStorm — 2017.1+).
This repository contains docs and sample configurations for various tools (e.g. Jest, Ava).
Want to share your config? Send a pull request.
Create file .idea/rc-producer.yml
in your project root (where .idea
is a IntelliJ Platform project configuration directory).
Sample files for: Jest
In most cases you just need to change files
according to your needs.
Option object or list of option objects are expected on root level.
Example of option object list:
-
files: ["test/src/**/*", "!**/helpers/**/*",]
-
files: ["bar",]
YAML allows you to avoid duplication — Merging Options.
You can override:
- &defaults
files: ["test/src/**/*", "!**/helpers/**/*"]
script: "node_modules/.bin/jest"
scriptArgs: ["-i", "--env", "jest-environment-node-debug", &filePattern '/${fileNameWithoutExt}\.\w+$']
rcName: "${fileNameWithoutExt}"
beforeRun: typescript
-
<<: *defaults
lineRegExp: '^\s*(?:test|it)(?:\.\w+)?\("([^"'']+)'
scriptArgs: ["-i", "--env", "jest-environment-node-debug", "-t", "${0regExp}", *filePattern]
rcName: "${fileNameWithoutExt}.${0}"
Or move list of option objects to property rc
:
defaults: &defaults
files: ["test/src/**/*", "!**/helpers/**/*"]
script: "node_modules/.bin/jest"
beforeRun: typescript
rc:
-
<<: *defaults
lineRegExp: '^\s*(?:test|it)(?:\.\w+)?\("([^"'']+)'
scriptArgs: ["-i", "-t", "${0regExp}", "${fileNameWithoutExt}"]
rcName: "${fileNameWithoutExt}.${0}"
-
<<: *defaults
scriptArgs: ["-i", "${fileNameWithoutExt}"]
rcName: "${fileNameWithoutExt}"