725fbc29ce
<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:
-->
# Description
fixes #31159
fixes #44553
Path aliases defined in `tsconfig.json` or `jsconfig.json` are not
automatically configured to work with Jest. This means that these
aliases have to be defined in multiple places.
This PR configures the SWC Jest transform to handle the `baseUrl` and
`paths`, so that users don't need to configure a `moduleNameMapper` for
Jest.
~This PR intends to make the experience more seamless by automatically
configuring Jest's `moduleNameMapper` and `moduleDirectories` based on
the settings in a project's `tsconfig`/`jsconfig`.~
~Users will be able to supply their own configuration for these fields,
if they have use-cases that require manual configuration.~
~The implementation is taken from the [`paths-to-module-name-mapper`
function in
`ts-jest`](
|
||
---|---|---|
.. | ||
app-dir/app-only-flag | ||
app-dir-edge-runtime-with-wasm | ||
app-dir-hide-suppressed-error-during-next-export | ||
app-dir-prefetch-non-iso-url | ||
ci-missing-typescript-deps | ||
custom-error-500 | ||
custom-server | ||
dependencies-can-use-env-vars-in-middlewares | ||
disable-fallback-polyfills | ||
edge-config-validations | ||
edge-runtime-is-addressable | ||
emit-decorator-metadata | ||
enoent-during-require | ||
escheck-output | ||
eslint-plugin-deps | ||
export | ||
exported-runtimes-value-validation | ||
fallback-export-error | ||
fatal-render-errror | ||
generate-middleware-source-maps | ||
jest | ||
middleware-environment-variables-in-node-server-reflect-the-usage-inference | ||
middleware-typescript | ||
next-font | ||
pnpm-support | ||
postcss-plugin-config-as-string | ||
prerender-prefetch | ||
reading-request-body-in-middleware | ||
standalone-mode | ||
supports-module-resolution-nodenext | ||
typescript-basic |