From 66811df8c4745da32cd8a613ea174d01a8dec404 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 24 Apr 2022 14:17:29 +0200 Subject: [PATCH 1/2] chorer: add note about babel config to upgrade guide --- docs/UpgradingToJest28.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/UpgradingToJest28.md b/docs/UpgradingToJest28.md index f329c731343f..60c16a6361b6 100644 --- a/docs/UpgradingToJest28.md +++ b/docs/UpgradingToJest28.md @@ -7,7 +7,7 @@ Upgrading Jest from v27 to v28? This guide aims to help refactoring your configu :::info -See [changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) for the full list of changes. +See [changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md#2800) for the full list of changes. ::: @@ -182,3 +182,7 @@ import {jest} from '@jest/globals'; .mockResolvedValue('default') .mockResolvedValueOnce('first call'); ``` + +## Babel config + +`babel-jest` now passes `root: config.rootDir` to Babel when resolving configuration. This improves compatibility when using `projects` with differing configuration, but it might mean your babel config isn't picked up in the same way anymore. You can override this option by passing options to `babel-jest` in your [configuration](Configuration.md#transform-objectstring-pathtotransformer--pathtotransformer-object). From b9c1df2900fa028044963096fc210b6f19f88348 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 24 Apr 2022 14:43:22 +0200 Subject: [PATCH 2/2] move --- docs/UpgradingToJest28.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/UpgradingToJest28.md b/docs/UpgradingToJest28.md index 60c16a6361b6..9c507970ad99 100644 --- a/docs/UpgradingToJest28.md +++ b/docs/UpgradingToJest28.md @@ -43,6 +43,10 @@ The `testURL` option is removed. Now you should use [`testEnvironmentOptions`](C + } ``` +### Babel config + +`babel-jest` now passes `root: config.rootDir` to Babel when resolving configuration. This improves compatibility when using `projects` with differing configuration, but it might mean your babel config isn't picked up in the same way anymore. You can override this option by passing options to `babel-jest` in your [configuration](Configuration.md#transform-objectstring-pathtotransformer--pathtotransformer-object). + ## Fake Timers Fake timers were refactored to allow passing options to the underlying [`@sinonjs/fake-timers`](https://github.com/sinonjs/fake-timers). @@ -182,7 +186,3 @@ import {jest} from '@jest/globals'; .mockResolvedValue('default') .mockResolvedValueOnce('first call'); ``` - -## Babel config - -`babel-jest` now passes `root: config.rootDir` to Babel when resolving configuration. This improves compatibility when using `projects` with differing configuration, but it might mean your babel config isn't picked up in the same way anymore. You can override this option by passing options to `babel-jest` in your [configuration](Configuration.md#transform-objectstring-pathtotransformer--pathtotransformer-object).