From 72e0b77fbe4ee7c354460a88d784c22634bec3cb Mon Sep 17 00:00:00 2001 From: Josh Kelly Date: Thu, 18 Mar 2021 12:13:16 +0000 Subject: [PATCH] Switch ts-node `Register` type to `Service` due to deprecation ts-node has moved to deprecate the `Register` type in favour of `Service`, this change updates that type. --- CHANGELOG.md | 1 + packages/jest-config/src/readConfigFileAndSetRootDir.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 746172c7f036..0cef7f40d44a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,6 +139,7 @@ - `[eslint-config-fb-strict]` Move package from this repo to `fbjs` repo ([#10739](https://github.com/facebook/jest/pull/10739)) - `[examples]` Update TypeScript example to show use of newer Jest types ([#10399](https://github.com/facebook/jest/pull/10399)) - `[jest-cli]` chore: standardize files and folder names ([#10698](https://github.com/facebook/jest/pull/10698)) +- `[jest-config]` Switch ts-node `Register` type to `Service` due to deprecation ([#11210](https://github.com/facebook/jest/pull/11210)) ## 26.6.1 diff --git a/packages/jest-config/src/readConfigFileAndSetRootDir.ts b/packages/jest-config/src/readConfigFileAndSetRootDir.ts index 508b68e94519..953c3160be0d 100644 --- a/packages/jest-config/src/readConfigFileAndSetRootDir.ts +++ b/packages/jest-config/src/readConfigFileAndSetRootDir.ts @@ -7,7 +7,7 @@ import * as path from 'path'; import * as fs from 'graceful-fs'; -import type {Register} from 'ts-node'; +import type {Service} from 'ts-node'; import type {Config} from '@jest/types'; import {interopRequireDefault, requireOrImportModule} from 'jest-util'; import { @@ -79,7 +79,7 @@ export default async function readConfigFileAndSetRootDir( const loadTSConfigFile = async ( configPath: Config.Path, ): Promise => { - let registerer: Register; + let registerer: Service; // Register TypeScript compiler instance try {