aelbore / esbuild-jest

A Jest transformer using esbuild
519 stars 51 forks source link

All tests are reporting: The JSX syntax extension is not currently enabled #95

Closed azcn2503 closed 11 months ago

azcn2503 commented 11 months ago

Hello.

I am dropping esbuild-jest into an existing project that previously used ts-node.

The jest config is specified in package.json for my repository instead of in jest.config.js, but that's fine. I have copied over the relevant parts of config so that my package.json looks like this:

...
  "jest": {
    "transform": {
      "^.+\\.tsx?$": "esbuild-jest"
    }
  }
...

When running jest, I get output like this:

 FAIL  client/app/views/alerts/alerts.test.js
  ● Test suite failed to run

    Transform failed with 1 error:
    <stdin>:15:6: ERROR: The JSX syntax extension is not currently enabled

      at failureErrorWithLog (node_modules/esbuild/lib/main.js:1650:15)
      at node_modules/esbuild/lib/main.js:848:29
      at responseCallbacks.<computed> (node_modules/esbuild/lib/main.js:703:9)
      at handleIncomingPacket (node_modules/esbuild/lib/main.js:763:9)

I am using the following versions: