Socket
Socket
Sign inDemoInstall

@alloc/esbuild-jest

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@alloc/esbuild-jest

Jest plugin to use esbuild for transformation


Version published
Maintainers
1
Created
Source

esbuild-jest

npm Code style: Prettier Donate

Jest transformer with esbuild speed

This is a fork of esbuild-jest with the following added features:

  • Sourcemaps enabled by default
  • Strict mode enabled for modules
  • Hoisted jest.mock calls with nebu

Install

yarn add esbuild-jest@npm:@alloc/esbuild-jest esbuild -D
Setting up Jest config file

esbuild-jest transformer should be used in your Jest config file like this:

{
  "transform": {
    "^.+\\.tsx?$": "esbuild-jest"
  }
}
Setting up Jest config file with transformOptions
export interface Options {
  jsxFactory?: string
  jsxFragment?: string
  loaders?: {
    [ext: string]: Loader
  }
  target?: string
}
{
  "transform": {
    "^.+\\.tsx?$": [
      "esbuild-jest",
      {
        loaders: {
          '.spec.ts': 'tsx'
        }
      }
    ]
  }
}

Keywords

FAQs

Package last updated on 11 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc