diff --git a/config/config/package.json b/config/config/package.json
index d676f51ea8..0c12b17afd 100644
--- a/config/config/package.json
+++ b/config/config/package.json
@@ -66,6 +66,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
diff --git a/config/config/test/globalBinDir.test.ts b/config/config/test/globalBinDir.test.ts
index 06eb477e6b..7b6ee85fd4 100644
--- a/config/config/test/globalBinDir.test.ts
+++ b/config/config/test/globalBinDir.test.ts
@@ -1,6 +1,7 @@
///
import fs from 'fs'
import { tempDir } from '@pnpm/prepare'
+import { jest } from '@jest/globals'
import path from 'path'
import pathName from 'path-name'
import symlinkDir from 'symlink-dir'
@@ -11,7 +12,8 @@ const globalBinDir = path.join(homedir(), '.local', 'pnpm')
const isWindows = process.platform === 'win32'
jest.mock('@pnpm/npm-conf/lib/conf', () => {
- const originalModule = jest.requireActual('@pnpm/npm-conf/lib/conf')
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ const originalModule = jest.requireActual('@pnpm/npm-conf/lib/conf')
class MockedConf extends originalModule {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
constructor (base: any, types: any) {
diff --git a/config/config/test/index.ts b/config/config/test/index.ts
index 2e1fbaf69d..b8b004726e 100644
--- a/config/config/test/index.ts
+++ b/config/config/test/index.ts
@@ -7,6 +7,7 @@ import { getConfig } from '@pnpm/config'
import loadNpmConf from '@pnpm/npm-conf'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
+import { jest } from '@jest/globals'
import symlinkDir from 'symlink-dir'
diff --git a/config/package-is-installable/package.json b/config/package-is-installable/package.json
index ae5e5ad171..fc04bf2cac 100644
--- a/config/package-is-installable/package.json
+++ b/config/package-is-installable/package.json
@@ -46,6 +46,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/package-is-installable": "workspace:*",
"@types/semver": "catalog:"
diff --git a/config/package-is-installable/test/checkPlatform.ts b/config/package-is-installable/test/checkPlatform.ts
index 1f1464fd89..358633f3c2 100644
--- a/config/package-is-installable/test/checkPlatform.ts
+++ b/config/package-is-installable/test/checkPlatform.ts
@@ -1,9 +1,11 @@
+import { jest } from '@jest/globals'
+import type * as DetectLibc from 'detect-libc'
import { checkPlatform } from '../lib/checkPlatform'
const packageId = 'registry.npmjs.org/foo/1.0.0'
jest.mock('detect-libc', () => {
- const original = jest.requireActual('detect-libc')
+ const original = jest.requireActual('detect-libc')
return {
...original,
familySync: () => 'musl',
diff --git a/config/plugin-commands-config/package.json b/config/plugin-commands-config/package.json
index fc5b59787a..f1c1840f8f 100644
--- a/config/plugin-commands-config/package.json
+++ b/config/plugin-commands-config/package.json
@@ -50,6 +50,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/plugin-commands-config": "workspace:*",
"@pnpm/prepare": "workspace:*",
diff --git a/config/plugin-commands-config/test/managingAuthSettings.test.ts b/config/plugin-commands-config/test/managingAuthSettings.test.ts
index cdecfef222..938ead9ae7 100644
--- a/config/plugin-commands-config/test/managingAuthSettings.test.ts
+++ b/config/plugin-commands-config/test/managingAuthSettings.test.ts
@@ -1,5 +1,6 @@
import { config } from '@pnpm/plugin-commands-config'
import { runNpm } from '@pnpm/run-npm'
+import { jest } from '@jest/globals'
jest.mock('@pnpm/run-npm', () => ({
runNpm: jest.fn(),
diff --git a/deps/status/package.json b/deps/status/package.json
index 2025d63e2c..24bf0d60a7 100644
--- a/deps/status/package.json
+++ b/deps/status/package.json
@@ -53,6 +53,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.status": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/write-project-manifest": "workspace:*",
diff --git a/deps/status/test/checkDepsStatus.test.ts b/deps/status/test/checkDepsStatus.test.ts
index 24e390db1f..35a9f1a739 100644
--- a/deps/status/test/checkDepsStatus.test.ts
+++ b/deps/status/test/checkDepsStatus.test.ts
@@ -2,22 +2,23 @@ import { type Stats } from 'fs'
import { checkDepsStatus, type CheckDepsStatusOptions } from '@pnpm/deps.status'
import * as workspaceStateModule from '@pnpm/workspace.state'
import * as lockfileFs from '@pnpm/lockfile.fs'
+import { jest } from '@jest/globals'
import * as fsUtils from '../lib/safeStat'
import * as statManifestFileUtils from '../lib/statManifestFile'
jest.mock('../lib/safeStat', () => ({
- ...jest.requireActual('../lib/safeStat'),
+ ...jest.requireActual