# jest-editor-support

> [![Build Status](https://github.com/jest-community/jest-editor-support/actions/workflows/node-ci.yml/badge.svg)](https://github.com/jest-community/jest-editor-support/actions) [![Coverage Status](https://coveralls.io/repos/github/jest-community/jest-edito

Latest version **32.0.0-beta.1** (published 2024-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install jest-editor-support
pnpm add jest-editor-support
yarn add jest-editor-support
bun add jest-editor-support
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 32.0.0-beta.1 |
| Published | 2024-06-05 |
| First published | 2016-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 62.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 31 |
| Maintainers | rubennorte, cpojer, captbaritone, orta, jeanlauliac, aaronabramov, connectdotz |

## Links

- npm: https://www.npmjs.com/package/jest-editor-support
- Repository: https://github.com/jest-community/jest-editor-support
- Homepage: https://github.com/jest-community/jest-editor-support#readme
- Issues: https://github.com/jest-community/jest-editor-support/issues
- npm.io page: https://npm.io/package/jest-editor-support

## Dependencies (7)

- [@jest/types](https://npm.io/package/@jest/types.md) ^29.3.1
- [@babel/types](https://npm.io/package/@babel/types.md) ^7.20.7
- [@babel/parser](https://npm.io/package/@babel/parser.md) ^7.20.7
- [jest-snapshot](https://npm.io/package/jest-snapshot.md) ^30.0.0-alpha.5
- [@babel/traverse](https://npm.io/package/@babel/traverse.md) 7.23.2
- [@jest/test-result](https://npm.io/package/@jest/test-result.md) ^29.3.1
- [@jest/snapshot-utils](https://npm.io/package/@jest/snapshot-utils.md) ^30.0.0-alpha.5

## Recent versions

- 32.0.0-beta.1 (latest) — 2024-06-05
- 28.0.0-beta.0 (beta) — 2020-06-07
- 21.3.0-beta.15 (test) — 2017-12-15
- 32.0.0-beta.0 — 2024-04-20
- 31.1.2 — 2023-10-31
- 31.1.1 — 2023-08-13
- 31.1.0 — 2023-06-14
- 31.0.1 — 2023-01-15
- 31.0.0 — 2023-01-12
- 30.3.1 — 2022-11-20
- 30.3.0 — 2022-11-18
- 30.2.1 — 2022-11-11
- 30.2.0 — 2022-09-25
- 30.1.0 — 2022-05-30
- 30.0.2 — 2021-09-27
- … 104 more at https://npm.io/package/jest-editor-support/versions

## README

# jest-editor-support

[![Build Status](https://github.com/jest-community/jest-editor-support/actions/workflows/node-ci.yml/badge.svg)](https://github.com/jest-community/jest-editor-support/actions) [![Coverage Status](https://coveralls.io/repos/github/jest-community/jest-editor-support/badge.svg?branch=master)](https://coveralls.io/github/jest-community/jest-editor-support?branch=master) [![npm version](https://badge.fury.io/js/jest-editor-support.svg)](https://badge.fury.io/js/jest-editor-support)


The engine that allows editors to build on top of Jest.

## Usage

This is only useful if you are interested in building an editor integration for Jest.

## API
```ts
parse(   
  filePath: string,   
  serializedData?: string,   
  options?: JESParserOptions
);

JESParserOptions = 
{
    plugins?: JESParserPluginOptions;
    strictMode?: boolean;
};

JESParserPluginOptions = 
{
  decorators?: 'legacy' | {
    decoratorsBeforeExport?: boolean;
    allowCallParenthesized?: boolean;
  }
}
```

Parse is a static Jest parser which uses Babel 7 and supports js,jsx,mjs,ts,tsx files.   

[Supported ECMAScript proposals](https://github.com/babel/babel/blob/928b9f8c9518284eac6d0598633f2ec373fc6d0c/packages/babel-parser/typings/babel-parser.d.ts#L97)

- filePath = Path to the file you want to parse.
- serializedData = Serialized data, will be used instead of the filePath if available (optional).
- options: 
  - strictMode = If this option is activated the parser throws an exception if the filetype is not detected, defaults to false.
  - pluginOptions = allow override for selected [plugins](https://babeljs.io/docs/en/babel-parser#plugins) options. Currently only support `decorators`. 

examples:
```ts
parse('test.spec.ts');
parse('parameterDecorators.spec.ts', undefined, {plugins: {decorators: 'legacy'}})
parse('parameterDecorators.spec.ts', undefined, 
  {plugins: 
    {decorators: 
      {decoratorsBeforeExport: false}
    }
  })
```

## Note

Since version `18.2.0` TypeScript is now a peer dependency. If you don't need to handle `.tsx` files then you can safely ignore the warning during installation.

---
_Source: https://npm.io/package/jest-editor-support · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
