Jest Test Language Support
Jest Test Language Support provides syntax highlighting for your Jest global & lifecycle functions, and matchers.
Features
- Syntax highlighting for Jest test files
- Supports
.spec & .test for JS, JSX, Typescript
How to Setup Custom Themes
Open Preferences: Open Settings (JSON) from the Command Palette in VSCode
Add custom styles to your theme of choice:
{
"editor.tokenColorCustomizations": {
"[ThemeNameGoesHere]": {
"textMateRules": [
{
"scope": "your.scope.selector",
"foreground": "#8d8feb",
"fontStyle": "bold"
},
...
]
}
}
}
Example Theme Config
Scope Selectors
Below is a list of of scope selectors that can be used to set custom syntax color and font style.
Scope |
Description |
scope.jest.test |
root scope |
jest-global-function |
global jest functions |
jest-lifecycle.[name] |
Jest lifecycles (beforeAll , afterEach , etc.) |
expect-statement |
Highlights expect |
describe-block |
Highlights describe |
it-block |
Highlights it |
jest-matcher.[name] |
Jest matchers (toEqual , toMatchSnapshot , etc.) |
jest-matcher-prefix.not |
Jest matcher prefix for not |
Check out this VS's Syntax Highlighting Guide
if you want to learn more about TextMate scope and selectors
Matchers
Jest Test Language Support - VSMarketplace
vscode-jest
Jest Snapshot Language Support
| |