New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@macro-plugin/jest

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@macro-plugin/jest

Macro Plugins integration for jest

latest
Source
npmnpm
Version
1.1.2
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@macro-plugin/jest

Macro Plugin integration for jest. It supports transform macros and typescript and also jsx.

Installation

# 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:

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:

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:

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

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

Or with commonjs

macros.config.js

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

License

MIT

Keywords

jest

FAQs

Package last updated on 16 Jun 2023

Related posts