rsnext/test/production
John Daly 725fbc29ce
[next/jest] Support path aliases from tsconfig/jsconfig (#45815)
<!--
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`](5a0880add0/src/config/paths-to-module-name-mapper.ts).~

## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the
feature request has been accepted for implementation before opening a
PR.
- [x] Related issues linked using `fixes #number`
- [ ]
[e2e](https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have a helpful link attached, see
[`contributing.md`](https://github.com/vercel/next.js/blob/canary/contributing.md)

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
2023-03-01 10:52:32 +01:00
..
app-dir/app-only-flag Add support for --experimental-app-only (#45352) 2023-01-28 10:48:32 -08:00
app-dir-edge-runtime-with-wasm fix: usage of wasm in an appDir page file using the edge runtime (#41689) 2022-11-03 01:18:03 +00:00
app-dir-hide-suppressed-error-during-next-export Don't log suppressed error during export (#45100) 2023-01-23 08:28:30 +01:00
app-dir-prefetch-non-iso-url Ensure next.url is used instead of next.appPort (#44163) 2022-12-19 13:29:50 -08:00
ci-missing-typescript-deps Add types as a default dependency into tests (#44140) 2022-12-19 19:05:53 +01:00
custom-error-500 Fix handling with custom _error and pages/500 (#40110) 2022-08-30 18:14:12 -05:00
custom-server Add simple test that custom server works (#44536) 2023-01-11 10:25:44 +00:00
dependencies-can-use-env-vars-in-middlewares feat(middleware)!: forbids middleware response body (#36835) 2022-05-19 22:02:20 +00:00
disable-fallback-polyfills Update flakey polyfills and acceptance tests (#45313) 2023-01-26 10:25:47 -08:00
edge-config-validations Rename allowDynamic to unstable_allowDynamic (#40496) 2022-09-12 15:32:18 -07:00
edge-runtime-is-addressable Upgrade edge-runtime + make EdgeRuntime value overridable with an env var on compilation (#38331) 2022-07-12 15:18:59 +00:00
emit-decorator-metadata Ensure next.url is used instead of next.appPort (#44163) 2022-12-19 13:29:50 -08:00
enoent-during-require Ensure ENOENT error is not ignored when loading pages (#37486) 2022-06-06 14:35:26 -04:00
escheck-output BREAKING CHANGE: Remove browsersListForSwc and change default to legacyBrowsers: false (#41529) 2022-10-19 01:38:39 +00:00
eslint-plugin-deps Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
export Refactor next export tests (#45227) 2023-02-02 16:22:54 +00:00
exported-runtimes-value-validation feat: enhance warning messages about unanalyzable config field (#38907) 2022-07-22 19:31:47 +00:00
fallback-export-error Update check for fallback pages during export (#33323) 2022-01-17 14:44:45 +00:00
fatal-render-errror Ensure default _app is used when falling back to default _error (#39467) 2022-08-10 11:36:22 -05:00
generate-middleware-source-maps feat: enables 'edge' as a possible runtime for API routes (#44045) 2022-12-15 10:08:03 +01:00
jest [next/jest] Support path aliases from tsconfig/jsconfig (#45815) 2023-03-01 10:52:32 +01:00
middleware-environment-variables-in-node-server-reflect-the-usage-inference feat(middleware)!: forbids middleware response body (#36835) 2022-05-19 22:02:20 +00:00
middleware-typescript Upgrade typescript to 4.8.2 (#39979) 2022-08-29 16:56:02 +00:00
next-font Add next/font import (#45891) 2023-02-16 15:33:39 +01:00
pnpm-support Ensure build trace ignores apply correctly when nested (#42606) 2022-11-07 17:43:58 -08:00
postcss-plugin-config-as-string allow to provide postcss plugin options as a string (#35173) 2022-04-08 16:58:50 +00:00
prerender-prefetch Update flakey test cases (#45290) 2023-01-25 22:55:49 -08:00
reading-request-body-in-middleware fix(stream): Allows body larger than 16 KiB with middleware (#41270) 2022-10-17 15:26:16 -07:00
standalone-mode Add relative app dir field (#46393) 2023-02-24 16:51:07 -08:00
supports-module-resolution-nodenext Stop overriding the user's TS config with defaults during next build (#45670) 2023-02-15 18:11:00 +01:00
typescript-basic Fix next/dynamic types for resolving named export module (#43923) 2022-12-10 17:35:13 +00:00