GitXplorerGitXplorer
a

es-jest

public
20 stars
5 forks
1 issues

Commits

List of commits on branch main.
Unverified
5550ab6b012dcc8953a25e51af859bf61e7781aa

chore(release): 2.1.0

aambar committed 2 years ago
Unverified
5a0ee6ee3a18a3d420a7623be209584619e82a73

docs: update readme

aambar committed 2 years ago
Verified
a3f7e56a6356a59b113ebb1875fa51ebef15ded3

feat: add support for transformer config (#4)

mmlegenhausen committed 2 years ago
Unverified
edd4bb53e32424db5395c7f1cde6916cbccc2e51

chore(release): 2.0.0

aambar committed 3 years ago
Unverified
869aba6b7c1f33f958e358b774815a88de3e89e0

feat!: support Jest 28

aambar committed 3 years ago
Unverified
1692845bb3288ccb9f049b97d12d8e72781b2c53

chore(release): 1.5.0

aambar committed 3 years ago

README

The README file for this repository.

es-jest

ESM/React/TypeScript preprocessor for Jest, powered by esbuild.

build status npm version

Install

npm install es-jest --save-dev

Usage

Add preset to Jest config:

{
  "jest": {
    "preset": "es-jest"
  }
}

// alternatively, specifying the files to transform:
{
  "jest": {
    "transform": {
      "\\.[jt]sx?$": "es-jest"
    },
  }
}

// you can also provide a custom esbuild config:
{
  "jest": {
    "transform": {
      "\\.[jt]sx?$": ["es-jest", { "jsx": "automatic" }]
    },
  }
}

Write your tests with ES modules:

import path from 'path'

test('parses extname', () => {
  expect(path.extname('foo.md')).toBe('.md')
})

Happy testing!

Related