-
Notifications
You must be signed in to change notification settings - Fork 214
Jest preset improvements #851
Comments
Issue 2 above was fixed as part of #852. As for the rest, I've found a couple of different approaches that use babel-jest (rather than reimplementing bits of it), though hit a caching bug, which I've fixed upstream in jestjs/jest#6699. We now need to wait for it to be included in a released version. Ideally I'd also like to be able to ditch the custom transformer entirely, but this would require further changes to upstream to add an additional option for specifying the custom transformer options. I'll see if they are open to supporting this. |
Any updates here? Does this still need to happen as part of v9? |
The PR to Jest was released in 23.4.2, I don't think this needs anything from Jest now? |
@edmorley do you think it's sufficient then to just open a patch for the |
I've opened #1183 which switches us to using babel-jest. |
We were previously just reimplementing parts of it, and not using the latest recommended Babel settings (such as still setting `retainLines: true` when sourcemaps are supported natively). There isn't currently a way to set the babel-jest `createTransformer()` options via Jest configuration/globals, so we instead have to resort to using an environment variable. This has the limitation of only supporting Babel options that are serializable (virtually all commonly used configuration options are), with any others being silently omitted. However this was already the case when using `globals` anyway. See: https://github.com/facebook/jest/blob/v23.6.0/packages/babel-jest/README.md https://github.com/facebook/jest/blob/v23.6.0/packages/babel-jest/src/index.js Fixes #851.
Whilst working on #845 I found a few areas of improvement for the Jest preset:
the Jest config is unnecessarily saved to a temporary file, when we can instead pass via theFixed by Morph Neutrino API and CLI into middleware injectors for external CLI tools #852.config
option (so long as it's stringified to avoid Can not use custom transfom by runCLI jestjs/jest#5429)retainLines
option which is no longer necessary, now that jest supports sourcemapsFor (1), see possible alternatives here:
#845 (comment)
The text was updated successfully, but these errors were encountered: