aelbore / esbuild-jest

A Jest transformer using esbuild
519 stars 51 forks source link

Add support for 'keepNames' property in esbuild options #67

Open vijaybritto opened 2 years ago

vijaybritto commented 2 years ago

If this is not specified then the names are modified by the esbuild transform like for ex:

function ErrorComponent () {}

is turned into

function ErrorComponent1() {}

The extra 1 is causing enzyme tests to fail in our setup and I tried adding keepLines options in the esbuild-jest package in node modules folder. Then it works without any issues.

It would be good to allow all options that are supported by esbuild instead of picking only a few.

I can open a PR if you'd like.