# @macro-plugin/jest

> Macro Plugins integration for jest

Latest version **1.1.2** (published 2023-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @macro-plugin/jest
pnpm add @macro-plugin/jest
yarn add @macro-plugin/jest
bun add @macro-plugin/jest
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2023-06-16 |
| First published | 2023-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 14.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Raven Satir |
| Maintainers | voorjaar |
| Keywords | jest, macro, macros, macro-plugin |

## Links

- npm: https://www.npmjs.com/package/@macro-plugin/jest
- Repository: https://github.com/macro-plugin/macros
- Homepage: https://github.com/macro-plugin/macros/tree/main/packages/jest
- Issues: https://github.com/macro-plugin/macros/issues
- npm.io page: https://npm.io/package/@macro-plugin/jest

## Dependencies (2)

- [@macro-plugin/core](https://npm.io/package/@macro-plugin/core.md) 1.2.0
- [@macro-plugin/shared](https://npm.io/package/@macro-plugin/shared.md) 1.2.1

## Recent versions

- 1.1.2 (latest) — 2023-06-16
- 1.1.1 — 2023-05-08
- 1.1.0 — 2023-05-03
- 1.0.6 — 2023-05-02
- 1.0.5 — 2023-04-27
- 1.0.4 — 2023-04-27
- 1.0.3 — 2023-04-24
- 1.0.2 — 2023-04-23
- 1.0.1 — 2023-04-22
- 1.0.0 — 2023-04-20

## README

# @macro-plugin/jest

[Macro Plugin](https://github.com/macro-plugin) integration for jest. It supports transform macros and typescript and also jsx.

## Installation

```sh
# if you use npm
npm i -D @macro-plugin/jest
# if you use pnpm
pnpm i -D @macro-plugin/jest
# if you use yarn
yarn add -D @macro-plugin/jest
```

## Usage

`jest.config.js`:

```js
module.exports = {
  transform: {
    '^.+\\.(t|j)sx?$': '@macro-plugin/jest',
  },
}
```

It will load the configuration from `macros.config.js` or `macros.config.ts` by default. You can also customize it:

```js
const fs = require('fs')
const config = require('./macros.config.js')

module.exports = {
  transform: {
    '^.+\\.(t|j)sx?$': ['@macro-plugin/jest', { ...config, /* custom configuration in Jest */ }],
  },
}
```

`macros.config.ts`:

```js
import { defineConfig } from "@macro-plugin/core"

export default defineConfig({
  macros: [],
  emitDts: true,
  jsc: {
    parser: {
      syntax: "typescript"
    },
    target: "esnext",
  },
})
```

Or with commonjs

`macros.config.js`

```js
/** @type {import("@macro-plugin/core").Config} */
module.exports = {
  macros: [],
  emitDts: true,
  jsc: {
    parser: {
      syntax: "typescript"
    },
    target: "esnext",
  },
}
```

## License

MIT

[MacroPlugin]: https://github.com/macro-plugin

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