diff --git a/__utils__/assert-project/package.json b/__utils__/assert-project/package.json
index 1e4a18148c..47c53b4b1d 100644
--- a/__utils__/assert-project/package.json
+++ b/__utils__/assert-project/package.json
@@ -45,6 +45,7 @@
"test": "pn pretest && pn compile && jest"
},
"dependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/assert-store": "workspace:*",
"@pnpm/constants": "workspace:*",
"@pnpm/installing.modules-yaml": "workspace:*",
diff --git a/__utils__/assert-project/src/index.ts b/__utils__/assert-project/src/index.ts
index cc49b3c939..f730474cd8 100644
--- a/__utils__/assert-project/src/index.ts
+++ b/__utils__/assert-project/src/index.ts
@@ -3,6 +3,7 @@ import { createRequire } from 'node:module'
import path from 'node:path'
import util from 'node:util'
+import { expect } from '@jest/globals'
import { assertStore } from '@pnpm/assert-store'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import type { Modules } from '@pnpm/installing.modules-yaml'
diff --git a/__utils__/assert-project/test/index.ts b/__utils__/assert-project/test/index.ts
index 163176d314..6173561478 100644
--- a/__utils__/assert-project/test/index.ts
+++ b/__utils__/assert-project/test/index.ts
@@ -1,6 +1,8 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { assertProject } from '../src/index.js'
test('assertProject()', async () => {
diff --git a/__utils__/assert-store/package.json b/__utils__/assert-store/package.json
index 792721b359..5970d1a905 100644
--- a/__utils__/assert-store/package.json
+++ b/__utils__/assert-store/package.json
@@ -32,12 +32,14 @@
"test": "pn pretest && pn compile && jest"
},
"dependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/registry-mock": "catalog:",
"@pnpm/store.cafs": "workspace:*",
"@pnpm/store.index": "workspace:*"
},
"devDependencies": {
"@pnpm/assert-store": "workspace:*",
- "@pnpm/constants": "workspace:*"
+ "@pnpm/constants": "workspace:*",
+ "@types/node": "catalog:"
}
}
diff --git a/__utils__/assert-store/src/index.ts b/__utils__/assert-store/src/index.ts
index ec5701518e..9f87cebb57 100644
--- a/__utils__/assert-store/src/index.ts
+++ b/__utils__/assert-store/src/index.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect } from '@jest/globals'
import { getIntegrity, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { StoreIndex, storeIndexKey } from '@pnpm/store.index'
diff --git a/__utils__/assert-store/test/index.ts b/__utils__/assert-store/test/index.ts
index 481d967423..318b7482de 100644
--- a/__utils__/assert-store/test/index.ts
+++ b/__utils__/assert-store/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertStore } from '@pnpm/assert-store'
import { STORE_VERSION } from '@pnpm/constants'
diff --git a/__utils__/test-ipc-server/package.json b/__utils__/test-ipc-server/package.json
index d2255718ef..3151831d9f 100644
--- a/__utils__/test-ipc-server/package.json
+++ b/__utils__/test-ipc-server/package.json
@@ -9,6 +9,7 @@
"test-ipc-server-client": "./bin/test-ipc-server-client.js"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/prepare": "workspace:*",
"@pnpm/test-ipc-server": "workspace:*",
"@types/node": "catalog:",
diff --git a/__utils__/test-ipc-server/test/TestIpcServer.test.ts b/__utils__/test-ipc-server/test/TestIpcServer.test.ts
index 217f97b873..dd797135e8 100644
--- a/__utils__/test-ipc-server/test/TestIpcServer.test.ts
+++ b/__utils__/test-ipc-server/test/TestIpcServer.test.ts
@@ -5,6 +5,7 @@ import path from 'node:path'
import { setTimeout } from 'node:timers/promises'
import { promisify } from 'node:util'
+import { describe, expect, it } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { createTestIpcServer } from '@pnpm/test-ipc-server'
import { safeExeca as execa } from 'execa'
diff --git a/__utils__/tsconfig/tsconfig.json b/__utils__/tsconfig/tsconfig.json
index 541d4691e9..92a17f7810 100644
--- a/__utils__/tsconfig/tsconfig.json
+++ b/__utils__/tsconfig/tsconfig.json
@@ -14,6 +14,7 @@
"sourceMap": true,
"strict": true,
"target": "es2022",
+ "types": ["node"],
"verbatimModuleSyntax": true
},
"atom": {
diff --git a/agent/server/test/integration.ts b/agent/server/test/integration.ts
index 9d2d053bea..8cfdc56def 100644
--- a/agent/server/test/integration.ts
+++ b/agent/server/test/integration.ts
@@ -4,7 +4,6 @@ import os from 'node:os'
import path from 'node:path'
import { afterAll, beforeAll, describe, expect, it, jest } from '@jest/globals'
-
// First run downloads packages from registry-mock — slow on Windows CI
jest.setTimeout(600_000)
import { fetchFromPnpmRegistry } from '@pnpm/agent.client'
diff --git a/auth/commands/test/login.test.ts b/auth/commands/test/login.test.ts
index 32e2df4e71..901b35d32f 100644
--- a/auth/commands/test/login.test.ts
+++ b/auth/commands/test/login.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { describe, expect, it, jest } from '@jest/globals'
import { login, type LoginContext, type LoginFetchResponse } from '../src/login.js'
diff --git a/auth/commands/test/logout.test.ts b/auth/commands/test/logout.test.ts
index b9ccc7ceaf..53d4b45fe9 100644
--- a/auth/commands/test/logout.test.ts
+++ b/auth/commands/test/logout.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { describe, expect, it, jest } from '@jest/globals'
import { logout, type LogoutContext, type LogoutFetchResponse } from '../src/logout.js'
@@ -64,7 +64,7 @@ describe('logout', () => {
})
it('should revoke token on registry and remove from auth.ini', async () => {
- const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
+ const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
let savedPath = ''
let savedSettings: Record = {}
@@ -104,7 +104,7 @@ describe('logout', () => {
})
it('should logout from a custom registry', async () => {
- const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
+ const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
let savedSettings: Record = {}
const context = createMockContext({
@@ -320,7 +320,7 @@ describe('logout', () => {
})
it('should URL-encode the token when revoking', async () => {
- const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
+ const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
const globalWarn = jest.fn()
const context = createMockContext({
@@ -375,7 +375,7 @@ describe('logout', () => {
})
it('should handle registry with a path', async () => {
- const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
+ const fetch = jest.fn(async () => createMockResponse({ ok: true, status: 200 }))
let savedSettings: Record = {}
const context = createMockContext({
diff --git a/bins/linker/test/getBinNodePaths.ts b/bins/linker/test/getBinNodePaths.ts
index dbf0931dca..dc9264079e 100644
--- a/bins/linker/test/getBinNodePaths.ts
+++ b/bins/linker/test/getBinNodePaths.ts
@@ -1,6 +1,7 @@
import fs, { promises as fsPromises } from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { temporaryDirectory } from 'tempy'
import { getBinNodePaths } from '../src/getBinNodePaths.js'
diff --git a/bins/linker/test/index.ts b/bins/linker/test/index.ts
index 6f23819f6b..2b66bfe0ff 100644
--- a/bins/linker/test/index.ts
+++ b/bins/linker/test/index.ts
@@ -3,7 +3,7 @@ import { spawnSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, describe, expect, jest, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import { cmdExtension as CMD_EXTENSION } from 'cmd-extension'
import isWindows from 'is-windows'
@@ -466,19 +466,18 @@ test('linkBins() would throw error if package has no name field', async () => {
const binTarget = temporaryDirectory()
const noNameFixture = f.prepare('no-name')
const warn = jest.fn()
+ const packagePath = normalizePath(path.join(noNameFixture, 'node_modules/simple'))
- try {
- await linkBins(path.join(noNameFixture, 'node_modules'), binTarget, {
+ await expect(
+ linkBins(path.join(noNameFixture, 'node_modules'), binTarget, {
allowExoticManifests: true,
warn,
})
- fail('linkBins should fail when package has no name')
- } catch (err: any) { // eslint-disable-line
- const packagePath = normalizePath(path.join(noNameFixture, 'node_modules/simple'))
- expect(err.message).toBe(`Package in ${packagePath} must have a name to get bin linked.`)
- expect(err.code).toBe('ERR_PNPM_INVALID_PACKAGE_NAME')
- expect(warn).not.toHaveBeenCalled()
- }
+ ).rejects.toMatchObject({
+ message: `Package in ${packagePath} must have a name to get bin linked.`,
+ code: 'ERR_PNPM_INVALID_PACKAGE_NAME',
+ })
+ expect(warn).not.toHaveBeenCalled()
})
test('linkBins() would give warning if package has no bin field', async () => {
diff --git a/bins/resolver/package.json b/bins/resolver/package.json
index cac2e12222..deecabfac2 100644
--- a/bins/resolver/package.json
+++ b/bins/resolver/package.json
@@ -38,6 +38,7 @@
"tinyglobby": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/bins.resolver": "workspace:*",
"@types/node": "catalog:",
"tempy": "catalog:"
diff --git a/bins/resolver/test/index.ts b/bins/resolver/test/index.ts
index 9cfebbb9df..ac39a60a9a 100644
--- a/bins/resolver/test/index.ts
+++ b/bins/resolver/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getBinsFromPackageManifest } from '@pnpm/bins.resolver'
test('getBinsFromPackageManifest()', async () => {
diff --git a/bins/resolver/test/path-traversal.test.ts b/bins/resolver/test/path-traversal.test.ts
index 48fd99e1fe..625ca321ad 100644
--- a/bins/resolver/test/path-traversal.test.ts
+++ b/bins/resolver/test/path-traversal.test.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getBinsFromPackageManifest } from '@pnpm/bins.resolver'
import { temporaryDirectory } from 'tempy'
diff --git a/building/commands/test/build/index.ts b/building/commands/test/build/index.ts
index 611663183d..8c0cf1a8b5 100644
--- a/building/commands/test/build/index.ts
+++ b/building/commands/test/build/index.ts
@@ -2,7 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, expect, jest, test } from '@jest/globals'
import { rebuild } from '@pnpm/building.commands'
import { ENGINE_NAME, STORE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { hashObject } from '@pnpm/crypto.object-hasher'
diff --git a/building/commands/test/build/recursive.ts b/building/commands/test/build/recursive.ts
index 1938ca0e0d..f74de85236 100644
--- a/building/commands/test/build/recursive.ts
+++ b/building/commands/test/build/recursive.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { rebuild } from '@pnpm/building.commands'
import { preparePackages } from '@pnpm/prepare'
diff --git a/building/commands/test/policy/approveBuilds.test.ts b/building/commands/test/policy/approveBuilds.test.ts
index a5f74ec1a8..c0b6f61757 100644
--- a/building/commands/test/policy/approveBuilds.test.ts
+++ b/building/commands/test/policy/approveBuilds.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { ApproveBuildsCommandOpts, RebuildCommandOpts } from '@pnpm/building.commands'
import { getConfig } from '@pnpm/config.reader'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
diff --git a/building/commands/test/policy/ignoredBuilds.test.ts b/building/commands/test/policy/ignoredBuilds.test.ts
index 29946d811e..b5b802e900 100644
--- a/building/commands/test/policy/ignoredBuilds.test.ts
+++ b/building/commands/test/policy/ignoredBuilds.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { ignoredBuilds } from '@pnpm/building.commands'
import { writeModulesManifest } from '@pnpm/installing.modules-yaml'
import { tempDir } from '@pnpm/prepare-temp-dir'
diff --git a/building/during-install/package.json b/building/during-install/package.json
index 878546ae2f..8828348518 100644
--- a/building/during-install/package.json
+++ b/building/during-install/package.json
@@ -56,6 +56,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/building.during-install": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/ramda": "catalog:"
diff --git a/building/during-install/test/buildSequence.test.ts b/building/during-install/test/buildSequence.test.ts
index d8cd52607b..11eb48dec3 100644
--- a/building/during-install/test/buildSequence.test.ts
+++ b/building/during-install/test/buildSequence.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { buildSequence } from '../lib/buildSequence.js'
test('buildSequence() test 1', () => {
diff --git a/building/policy/package.json b/building/policy/package.json
index 6cb52da56f..19f23f0e7a 100644
--- a/building/policy/package.json
+++ b/building/policy/package.json
@@ -35,6 +35,7 @@
"@pnpm/types": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/building.policy": "workspace:*"
},
"engines": {
diff --git a/building/policy/test/index.ts b/building/policy/test/index.ts
index e3a4691e4e..61a28bf51d 100644
--- a/building/policy/test/index.ts
+++ b/building/policy/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, it } from '@jest/globals'
import { createAllowBuildFunction } from '@pnpm/building.policy'
it('should allowBuilds with true value', () => {
diff --git a/cache/commands/package.json b/cache/commands/package.json
index 62dc8ef3ff..e681e02db8 100644
--- a/cache/commands/package.json
+++ b/cache/commands/package.json
@@ -45,6 +45,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/cache.commands": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",
diff --git a/cache/commands/test/cacheDelete.cmd.test.ts b/cache/commands/test/cacheDelete.cmd.test.ts
index aaf07a7587..81289648b0 100644
--- a/cache/commands/test/cacheDelete.cmd.test.ts
+++ b/cache/commands/test/cacheDelete.cmd.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { beforeEach, describe, expect, test } from '@jest/globals'
import { cache } from '@pnpm/cache.commands'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/cache/commands/test/cacheList.cmd.test.ts b/cache/commands/test/cacheList.cmd.test.ts
index 87f27959ae..24344daed7 100644
--- a/cache/commands/test/cacheList.cmd.test.ts
+++ b/cache/commands/test/cacheList.cmd.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { beforeAll, describe, expect, test } from '@jest/globals'
import { cache } from '@pnpm/cache.commands'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/cache/commands/test/cacheView.cmd.test.ts b/cache/commands/test/cacheView.cmd.test.ts
index 046e9b65a9..e2003060d7 100644
--- a/cache/commands/test/cacheView.cmd.test.ts
+++ b/cache/commands/test/cacheView.cmd.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { beforeEach, describe, expect, test } from '@jest/globals'
import { cache } from '@pnpm/cache.commands'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/catalogs/config/package.json b/catalogs/config/package.json
index 13116f720b..608d09b3ff 100644
--- a/catalogs/config/package.json
+++ b/catalogs/config/package.json
@@ -35,6 +35,7 @@
"@pnpm/error": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/catalogs.config": "workspace:*",
"@pnpm/catalogs.types": "workspace:*",
"@pnpm/workspace.workspace-manifest-reader": "workspace:*"
diff --git a/catalogs/config/test/getCatalogsFromWorkspaceManifest.test.ts b/catalogs/config/test/getCatalogsFromWorkspaceManifest.test.ts
index cdf595d6a1..a556211225 100644
--- a/catalogs/config/test/getCatalogsFromWorkspaceManifest.test.ts
+++ b/catalogs/config/test/getCatalogsFromWorkspaceManifest.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config'
test('combines implicit default and named catalogs', () => {
diff --git a/catalogs/protocol-parser/package.json b/catalogs/protocol-parser/package.json
index 8b333d6eff..926f77f413 100644
--- a/catalogs/protocol-parser/package.json
+++ b/catalogs/protocol-parser/package.json
@@ -32,6 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/catalogs.protocol-parser": "workspace:*"
},
"engines": {
diff --git a/catalogs/protocol-parser/test/parseCatalogProtocol.test.ts b/catalogs/protocol-parser/test/parseCatalogProtocol.test.ts
index 2fc3a3f8ae..a5a687d047 100644
--- a/catalogs/protocol-parser/test/parseCatalogProtocol.test.ts
+++ b/catalogs/protocol-parser/test/parseCatalogProtocol.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { parseCatalogProtocol } from '@pnpm/catalogs.protocol-parser'
test('parses named catalog', () => {
diff --git a/catalogs/resolver/test/resolveFromCatalog.test.ts b/catalogs/resolver/test/resolveFromCatalog.test.ts
index 4e2d7f6cd8..3614ef273d 100644
--- a/catalogs/resolver/test/resolveFromCatalog.test.ts
+++ b/catalogs/resolver/test/resolveFromCatalog.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import { matchCatalogResolveResult, resolveFromCatalog, type WantedDependency } from '@pnpm/catalogs.resolver'
import type { Catalogs } from '@pnpm/catalogs.types'
import { PnpmError } from '@pnpm/error'
diff --git a/cli/commands/test/completion/complete.test.ts b/cli/commands/test/completion/complete.test.ts
index d6a681c127..584a3ab004 100644
--- a/cli/commands/test/completion/complete.test.ts
+++ b/cli/commands/test/completion/complete.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { complete } from '../../src/completion/complete.js'
test('complete an option value', async () => {
diff --git a/cli/commands/test/completion/generateCompletion.ts b/cli/commands/test/completion/generateCompletion.ts
index 3d64f7dc9f..45f715b43e 100644
--- a/cli/commands/test/completion/generateCompletion.ts
+++ b/cli/commands/test/completion/generateCompletion.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { generateCompletion } from '@pnpm/cli.commands'
import { SUPPORTED_SHELLS } from '@pnpm/tabtab'
diff --git a/cli/commands/test/completion/getOptionType.test.ts b/cli/commands/test/completion/getOptionType.test.ts
index 0ccdb3ef55..db3ef8b370 100644
--- a/cli/commands/test/completion/getOptionType.test.ts
+++ b/cli/commands/test/completion/getOptionType.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import {
currentTypedWordType,
getLastOption,
diff --git a/cli/commands/test/completion/getShell.test.ts b/cli/commands/test/completion/getShell.test.ts
index e2d833932a..5103fa3733 100644
--- a/cli/commands/test/completion/getShell.test.ts
+++ b/cli/commands/test/completion/getShell.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getShellFromParams, getShellFromString } from '../../src/completion/getShell.js'
test('getShellFromString errors on undefined', () => {
diff --git a/cli/commands/test/completion/optionTypesToCompletions.test.ts b/cli/commands/test/completion/optionTypesToCompletions.test.ts
index f573cfa084..2eaafaaaa0 100644
--- a/cli/commands/test/completion/optionTypesToCompletions.test.ts
+++ b/cli/commands/test/completion/optionTypesToCompletions.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { optionTypesToCompletions } from '../../src/completion/optionTypesToCompletions.js'
test('optionTypesToCompletions', () => {
diff --git a/cli/default-reporter/package.json b/cli/default-reporter/package.json
index 281c5d47fe..ab9ed6bb26 100644
--- a/cli/default-reporter/package.json
+++ b/cli/default-reporter/package.json
@@ -58,6 +58,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/cli.default-reporter": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/normalize-path": "catalog:",
diff --git a/cli/default-reporter/test/filterLogHook.ts b/cli/default-reporter/test/filterLogHook.ts
index 8b93da0d8b..d5625d664a 100644
--- a/cli/default-reporter/test/filterLogHook.ts
+++ b/cli/default-reporter/test/filterLogHook.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Log } from '@pnpm/core-loggers'
import { createStreamParser, logger } from '@pnpm/logger'
diff --git a/cli/default-reporter/test/index.ts b/cli/default-reporter/test/index.ts
index f496a997cd..7a8a40a3f1 100644
--- a/cli/default-reporter/test/index.ts
+++ b/cli/default-reporter/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import {
diff --git a/cli/default-reporter/test/reportingContext.ts b/cli/default-reporter/test/reportingContext.ts
index 6d28af7597..36e28983a2 100644
--- a/cli/default-reporter/test/reportingContext.ts
+++ b/cli/default-reporter/test/reportingContext.ts
@@ -1,5 +1,6 @@
import { setTimeout } from 'node:timers/promises'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { contextLogger, packageImportMethodLogger } from '@pnpm/core-loggers'
import {
diff --git a/cli/default-reporter/test/reportingDeprecations.ts b/cli/default-reporter/test/reportingDeprecations.ts
index 8fe0cf2087..6143605e5e 100644
--- a/cli/default-reporter/test/reportingDeprecations.ts
+++ b/cli/default-reporter/test/reportingDeprecations.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import {
diff --git a/cli/default-reporter/test/reportingErrors.ts b/cli/default-reporter/test/reportingErrors.ts
index efbe1af363..557d6e5c91 100644
--- a/cli/default-reporter/test/reportingErrors.ts
+++ b/cli/default-reporter/test/reportingErrors.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { PnpmError } from '@pnpm/error'
import {
diff --git a/cli/default-reporter/test/reportingExecutionTime.ts b/cli/default-reporter/test/reportingExecutionTime.ts
index 1b5e04819b..36278499e6 100644
--- a/cli/default-reporter/test/reportingExecutionTime.ts
+++ b/cli/default-reporter/test/reportingExecutionTime.ts
@@ -1,5 +1,6 @@
import { setTimeout } from 'node:timers/promises'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { packageManager } from '@pnpm/cli.meta'
import { executionTimeLogger } from '@pnpm/core-loggers'
diff --git a/cli/default-reporter/test/reportingLifecycleScripts.ts b/cli/default-reporter/test/reportingLifecycleScripts.ts
index c03a38784e..8efa2de771 100644
--- a/cli/default-reporter/test/reportingLifecycleScripts.ts
+++ b/cli/default-reporter/test/reportingLifecycleScripts.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { lifecycleLogger } from '@pnpm/core-loggers'
import { createStreamParser } from '@pnpm/logger'
diff --git a/cli/default-reporter/test/reportingPeerDependencyIssues.ts b/cli/default-reporter/test/reportingPeerDependencyIssues.ts
index 4cb8834ef3..16a86a69a0 100644
--- a/cli/default-reporter/test/reportingPeerDependencyIssues.ts
+++ b/cli/default-reporter/test/reportingPeerDependencyIssues.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { peerDependencyIssuesLogger } from '@pnpm/core-loggers'
import {
diff --git a/cli/default-reporter/test/reportingProgress.ts b/cli/default-reporter/test/reportingProgress.ts
index db625ca8b2..ccb23519cf 100644
--- a/cli/default-reporter/test/reportingProgress.ts
+++ b/cli/default-reporter/test/reportingProgress.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import {
diff --git a/cli/default-reporter/test/reportingRequestRetry.ts b/cli/default-reporter/test/reportingRequestRetry.ts
index e2f90697b8..ef6df7497e 100644
--- a/cli/default-reporter/test/reportingRequestRetry.ts
+++ b/cli/default-reporter/test/reportingRequestRetry.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import { requestRetryLogger } from '@pnpm/core-loggers'
import {
diff --git a/cli/default-reporter/test/reportingScope.ts b/cli/default-reporter/test/reportingScope.ts
index 283a377d9d..8e518023f4 100644
--- a/cli/default-reporter/test/reportingScope.ts
+++ b/cli/default-reporter/test/reportingScope.ts
@@ -1,5 +1,6 @@
import { setTimeout } from 'node:timers/promises'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import { scopeLogger } from '@pnpm/core-loggers'
diff --git a/cli/default-reporter/test/reportingUpdateCheck.ts b/cli/default-reporter/test/reportingUpdateCheck.ts
index 848f797d97..89c7e4c9e9 100644
--- a/cli/default-reporter/test/reportingUpdateCheck.ts
+++ b/cli/default-reporter/test/reportingUpdateCheck.ts
@@ -1,6 +1,7 @@
import { setTimeout } from 'node:timers/promises'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { toOutput$ } from '@pnpm/cli.default-reporter'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import { updateCheckLogger } from '@pnpm/core-loggers'
diff --git a/cli/meta/package.json b/cli/meta/package.json
index def5e4f74b..fe716b278d 100644
--- a/cli/meta/package.json
+++ b/cli/meta/package.json
@@ -35,6 +35,7 @@
"load-json-file": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/cli.meta": "workspace:*"
},
"engines": {
diff --git a/cli/meta/test/getCurrentPackageName.test.ts b/cli/meta/test/getCurrentPackageName.test.ts
index 3c2de092bd..83b9cb8d88 100644
--- a/cli/meta/test/getCurrentPackageName.test.ts
+++ b/cli/meta/test/getCurrentPackageName.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { detectIfCurrentPkgIsExecutable, getCurrentPackageName, isExecutedByCorepack } from '@pnpm/cli.meta'
describe('detectIfCurrentPkgIsExecutable()', () => {
diff --git a/cli/parse-cli-args/package.json b/cli/parse-cli-args/package.json
index 6a6167abb6..894d0dbad7 100644
--- a/cli/parse-cli-args/package.json
+++ b/cli/parse-cli-args/package.json
@@ -38,6 +38,7 @@
"didyoumean2": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/cli.parse-cli-args": "workspace:*",
"tempy": "catalog:"
},
diff --git a/cli/parse-cli-args/test/index.ts b/cli/parse-cli-args/test/index.ts
index 68ca1f6a44..bb6239da3f 100644
--- a/cli/parse-cli-args/test/index.ts
+++ b/cli/parse-cli-args/test/index.ts
@@ -1,5 +1,6 @@
import os from 'node:os'
+import { expect, test } from '@jest/globals'
import { parseCliArgs } from '@pnpm/cli.parse-cli-args'
import type { PnpmError } from '@pnpm/error'
import { temporaryDirectory } from 'tempy'
diff --git a/config/commands/test/configDelete.test.ts b/config/commands/test/configDelete.test.ts
index 1afc6acdaa..4c00bbcd7c 100644
--- a/config/commands/test/configDelete.test.ts
+++ b/config/commands/test/configDelete.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { config } from '@pnpm/config.commands'
import { tempDir } from '@pnpm/prepare'
import { readIniFileSync } from 'read-ini-file'
diff --git a/config/commands/test/configGet.test.ts b/config/commands/test/configGet.test.ts
index 72c1c015f4..6a9c36298c 100644
--- a/config/commands/test/configGet.test.ts
+++ b/config/commands/test/configGet.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { config } from '@pnpm/config.commands'
import { createConfigCommandOpts, getOutputString } from './utils/index.js'
diff --git a/config/commands/test/configList.test.ts b/config/commands/test/configList.test.ts
index 3653603f6e..1e02fc120a 100644
--- a/config/commands/test/configList.test.ts
+++ b/config/commands/test/configList.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { config } from '@pnpm/config.commands'
import { createConfigCommandOpts, getOutputString } from './utils/index.js'
diff --git a/config/commands/test/configSet.test.ts b/config/commands/test/configSet.test.ts
index 7b1df8b985..455fc4c0af 100644
--- a/config/commands/test/configSet.test.ts
+++ b/config/commands/test/configSet.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { config } from '@pnpm/config.commands'
import { PnpmError } from '@pnpm/error'
import { tempDir } from '@pnpm/prepare'
diff --git a/config/commands/test/managingAuthSettings.test.ts b/config/commands/test/managingAuthSettings.test.ts
index 2c7279c184..b67d85b52e 100644
--- a/config/commands/test/managingAuthSettings.test.ts
+++ b/config/commands/test/managingAuthSettings.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { config } from '@pnpm/config.commands'
import { tempDir } from '@pnpm/prepare'
diff --git a/config/matcher/package.json b/config/matcher/package.json
index 59aa1aa13a..4fb4ea9fb1 100644
--- a/config/matcher/package.json
+++ b/config/matcher/package.json
@@ -37,6 +37,7 @@
"escape-string-regexp": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config.matcher": "workspace:*"
},
"engines": {
diff --git a/config/matcher/test/index.ts b/config/matcher/test/index.ts
index 00dff893a7..37c59ed88b 100644
--- a/config/matcher/test/index.ts
+++ b/config/matcher/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { createMatcher, createMatcherWithIndex } from '@pnpm/config.matcher'
test('matcher()', () => {
diff --git a/config/package-is-installable/test/checkEngine.ts b/config/package-is-installable/test/checkEngine.ts
index cf93df7fcb..f7fa2b6b23 100644
--- a/config/package-is-installable/test/checkEngine.ts
+++ b/config/package-is-installable/test/checkEngine.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { checkEngine } from '../lib/checkEngine.js'
const packageId = 'registry.npmjs.org/foo/1.0.0'
diff --git a/config/package-is-installable/test/checkPlatform.ts b/config/package-is-installable/test/checkPlatform.ts
index ad9b748ccc..ea6e91bdfe 100644
--- a/config/package-is-installable/test/checkPlatform.ts
+++ b/config/package-is-installable/test/checkPlatform.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type * as DetectLibc from 'detect-libc'
const packageId = 'registry.npmjs.org/foo/1.0.0'
diff --git a/config/parse-overrides/package.json b/config/parse-overrides/package.json
index dbaaa5c968..aa9407a18c 100644
--- a/config/parse-overrides/package.json
+++ b/config/parse-overrides/package.json
@@ -37,6 +37,7 @@
"@pnpm/resolving.parse-wanted-dependency": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config.parse-overrides": "workspace:*"
},
"engines": {
diff --git a/config/parse-overrides/test/index.ts b/config/parse-overrides/test/index.ts
index f72099488c..33a00b16e2 100644
--- a/config/parse-overrides/test/index.ts
+++ b/config/parse-overrides/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { parseOverrides } from '@pnpm/config.parse-overrides'
test.each([
diff --git a/config/pick-registry-for-package/package.json b/config/pick-registry-for-package/package.json
index 8edf77cf31..74de24d20b 100644
--- a/config/pick-registry-for-package/package.json
+++ b/config/pick-registry-for-package/package.json
@@ -34,6 +34,7 @@
"@pnpm/types": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config.pick-registry-for-package": "workspace:*"
},
"engines": {
diff --git a/config/pick-registry-for-package/test/index.spec.ts b/config/pick-registry-for-package/test/index.spec.ts
index 241f7cef2a..c82d41bc9d 100644
--- a/config/pick-registry-for-package/test/index.spec.ts
+++ b/config/pick-registry-for-package/test/index.spec.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { pickRegistryForPackage } from '@pnpm/config.pick-registry-for-package'
test('pick correct scope', () => {
diff --git a/config/reader/src/localConfig.test.ts b/config/reader/src/localConfig.test.ts
index ab2c5db0d3..c5e6c9b150 100644
--- a/config/reader/src/localConfig.test.ts
+++ b/config/reader/src/localConfig.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import type { InheritableConfigPair } from './inheritPickedConfig.js'
import { inheritAuthConfig, inheritDlxConfig } from './localConfig.js'
diff --git a/config/reader/test/concurrency.test.ts b/config/reader/test/concurrency.test.ts
index 84305dccc3..5420caf91e 100644
--- a/config/reader/test/concurrency.test.ts
+++ b/config/reader/test/concurrency.test.ts
@@ -1,6 +1,6 @@
import os, { cpus } from 'node:os'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { getDefaultWorkspaceConcurrency, getWorkspaceConcurrency, resetAvailableParallelismCache } from '../lib/concurrency.js'
diff --git a/config/reader/test/dirs.test.ts b/config/reader/test/dirs.test.ts
index 39d51ed8f9..35fcd774b7 100644
--- a/config/reader/test/dirs.test.ts
+++ b/config/reader/test/dirs.test.ts
@@ -1,6 +1,8 @@
import os from 'node:os'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { getCacheDir, getConfigDir, getDataDir, getStateDir } from '../lib/dirs.js'
test('getCacheDir()', () => {
diff --git a/config/reader/test/env.test.ts b/config/reader/test/env.test.ts
index 4513b78939..4cddfc5d98 100644
--- a/config/reader/test/env.test.ts
+++ b/config/reader/test/env.test.ts
@@ -1,6 +1,8 @@
import path from 'node:path'
import url from 'node:url'
+import { expect, test } from '@jest/globals'
+
import { type ConfigPair, type GetSchema, parseEnvVars, type Schema } from '../src/env.js'
function assertSchemaKey (key: string): void {
diff --git a/config/reader/test/getNetworkConfigs.test.ts b/config/reader/test/getNetworkConfigs.test.ts
index ca8be7a80d..1b09ca6859 100644
--- a/config/reader/test/getNetworkConfigs.test.ts
+++ b/config/reader/test/getNetworkConfigs.test.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { getNetworkConfigs, type NetworkConfigs } from '../src/getNetworkConfigs.js'
diff --git a/config/reader/test/getOptionsFromRootManifest.test.ts b/config/reader/test/getOptionsFromRootManifest.test.ts
index 8b9f6f758d..43f63ff6ea 100644
--- a/config/reader/test/getOptionsFromRootManifest.test.ts
+++ b/config/reader/test/getOptionsFromRootManifest.test.ts
@@ -1,3 +1,5 @@
+import { afterEach, expect, test } from '@jest/globals'
+
import { getOptionsFromPnpmSettings } from '../lib/getOptionsFromRootManifest.js'
const ORIGINAL_ENV = process.env
diff --git a/config/reader/test/globalBinDir.test.ts b/config/reader/test/globalBinDir.test.ts
index 2c0af20440..57668e10a3 100644
--- a/config/reader/test/globalBinDir.test.ts
+++ b/config/reader/test/globalBinDir.test.ts
@@ -3,6 +3,7 @@ import fs from 'node:fs'
import { homedir } from 'node:os'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import { tempDir } from '@pnpm/prepare'
import pathName from 'path-name'
diff --git a/config/reader/test/index.ts b/config/reader/test/index.ts
index 86c8288aa8..d62ed115a9 100644
--- a/config/reader/test/index.ts
+++ b/config/reader/test/index.ts
@@ -3,7 +3,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import PATH from 'path-name'
diff --git a/config/reader/test/overrideSupportedArchitecturesWithCLI.test.ts b/config/reader/test/overrideSupportedArchitecturesWithCLI.test.ts
index fd7d05318d..ae11c23893 100644
--- a/config/reader/test/overrideSupportedArchitecturesWithCLI.test.ts
+++ b/config/reader/test/overrideSupportedArchitecturesWithCLI.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { SupportedArchitectures } from '@pnpm/types'
import { type CliOptions, overrideSupportedArchitecturesWithCLI, type TargetConfig } from '../src/overrideSupportedArchitecturesWithCLI.js'
diff --git a/config/reader/test/parseCreds.test.ts b/config/reader/test/parseCreds.test.ts
index 08e74bc798..69247809fc 100644
--- a/config/reader/test/parseCreds.test.ts
+++ b/config/reader/test/parseCreds.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import {
AuthMissingSeparatorError,
type Creds,
diff --git a/config/reader/test/projectConfig.test.ts b/config/reader/test/projectConfig.test.ts
index 2190a1b701..d4699b30b8 100644
--- a/config/reader/test/projectConfig.test.ts
+++ b/config/reader/test/projectConfig.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { omit } from 'ramda'
import type {
diff --git a/config/reader/test/transformPath.test.ts b/config/reader/test/transformPath.test.ts
index 3f80f232a3..f7bbcf0af6 100644
--- a/config/reader/test/transformPath.test.ts
+++ b/config/reader/test/transformPath.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
+
import type { Config } from '../src/Config.js'
import { transformPath, transformPathKeys } from '../src/transformPath.js'
diff --git a/config/version-policy/package.json b/config/version-policy/package.json
index 133e212755..d45add0ae6 100644
--- a/config/version-policy/package.json
+++ b/config/version-policy/package.json
@@ -37,6 +37,7 @@
"semver": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config.version-policy": "workspace:*",
"@types/semver": "catalog:"
},
diff --git a/config/version-policy/test/index.ts b/config/version-policy/test/index.ts
index 365bb2d092..41f03137d9 100644
--- a/config/version-policy/test/index.ts
+++ b/config/version-policy/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { createPackageVersionPolicy } from '@pnpm/config.version-policy'
test('createPackageVersionPolicy()', () => {
diff --git a/core/error/package.json b/core/error/package.json
index 722cd57054..b718d31419 100644
--- a/core/error/package.json
+++ b/core/error/package.json
@@ -35,6 +35,7 @@
"@pnpm/constants": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/error": "workspace:*"
},
"engines": {
diff --git a/core/error/test/index.ts b/core/error/test/index.ts
index 6b38d32c65..7d3e046758 100644
--- a/core/error/test/index.ts
+++ b/core/error/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { FetchError, PnpmError } from '@pnpm/error'
test('PnpmError exposes cause when provided', () => {
diff --git a/core/logger/package.json b/core/logger/package.json
index c444dcecbd..10c6fe41ce 100644
--- a/core/logger/package.json
+++ b/core/logger/package.json
@@ -36,6 +36,7 @@
"split2": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*"
},
"engines": {
diff --git a/core/logger/test/index.test.ts b/core/logger/test/index.test.ts
index d89f588db3..e6b86741f3 100644
--- a/core/logger/test/index.test.ts
+++ b/core/logger/test/index.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { type LogBase, logger, streamParser } from '@pnpm/logger'
test('logger logs', async () => {
diff --git a/crypto/hash/package.json b/crypto/hash/package.json
index 598db01c75..486206e9a9 100644
--- a/crypto/hash/package.json
+++ b/crypto/hash/package.json
@@ -37,6 +37,7 @@
"ssri": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/crypto.hash": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@types/ssri": "catalog:",
diff --git a/crypto/hash/test/index.ts b/crypto/hash/test/index.ts
index dc13ef2b4c..669c3cc02e 100644
--- a/crypto/hash/test/index.ts
+++ b/crypto/hash/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import { pipeline } from 'node:stream/promises'
+import { expect, test } from '@jest/globals'
import { createHashFromFile, createShortHash, getTarballIntegrity } from '@pnpm/crypto.hash'
import { tempDir } from '@pnpm/prepare'
import tar from 'tar-stream'
diff --git a/crypto/integrity/package.json b/crypto/integrity/package.json
index 769131ba87..2b80566a72 100644
--- a/crypto/integrity/package.json
+++ b/crypto/integrity/package.json
@@ -36,6 +36,7 @@
"@pnpm/error": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/crypto.integrity": "workspace:*"
},
"engines": {
diff --git a/crypto/integrity/test/index.ts b/crypto/integrity/test/index.ts
index 6082328d13..2173244c26 100644
--- a/crypto/integrity/test/index.ts
+++ b/crypto/integrity/test/index.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { formatIntegrity, parseIntegrity } from '@pnpm/crypto.integrity'
describe('parseIntegrity', () => {
diff --git a/crypto/object-hasher/package.json b/crypto/object-hasher/package.json
index d5b36188dd..b3ffe7f0fc 100644
--- a/crypto/object-hasher/package.json
+++ b/crypto/object-hasher/package.json
@@ -37,6 +37,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/crypto.object-hasher": "workspace:*",
"@types/object-hash": "catalog:",
"@types/ramda": "catalog:"
diff --git a/crypto/object-hasher/test/index.ts b/crypto/object-hasher/test/index.ts
index 2ec06510f3..cbc797b80e 100644
--- a/crypto/object-hasher/test/index.ts
+++ b/crypto/object-hasher/test/index.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { hashObject, hashObjectNullableWithPrefix, hashObjectWithoutSorting } from '@pnpm/crypto.object-hasher'
describe('hashObject', () => {
diff --git a/crypto/shasums-file/package.json b/crypto/shasums-file/package.json
index ac7a1c98a3..1f6a2fc688 100644
--- a/crypto/shasums-file/package.json
+++ b/crypto/shasums-file/package.json
@@ -38,6 +38,7 @@
"@pnpm/fetching.types": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/crypto.shasums-file": "workspace:*"
},
"engines": {
diff --git a/crypto/shasums-file/test/index.ts b/crypto/shasums-file/test/index.ts
index d55af08d68..59c2e0b2a5 100644
--- a/crypto/shasums-file/test/index.ts
+++ b/crypto/shasums-file/test/index.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { pickFileChecksumFromShasumsFile } from '@pnpm/crypto.shasums-file'
describe('pickFileChecksumFromShasumsFile', () => {
diff --git a/deps/compliance/audit/package.json b/deps/compliance/audit/package.json
index 7cca55b069..ab6f20f65a 100644
--- a/deps/compliance/audit/package.json
+++ b/deps/compliance/audit/package.json
@@ -48,6 +48,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/constants": "workspace:*",
"@pnpm/deps.compliance.audit": "workspace:*",
"@pnpm/logger": "workspace:*",
diff --git a/deps/compliance/audit/test/index.ts b/deps/compliance/audit/test/index.ts
index 9f159cc409..fa26d64ffa 100644
--- a/deps/compliance/audit/test/index.ts
+++ b/deps/compliance/audit/test/index.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { audit, buildAuditPathIndex, lockfileToAuditRequest } from '@pnpm/deps.compliance.audit'
import type { PnpmError } from '@pnpm/error'
diff --git a/deps/compliance/commands/test/audit/fix.ts b/deps/compliance/commands/test/audit/fix.ts
index e0a5e8830b..6771d256c7 100644
--- a/deps/compliance/commands/test/audit/fix.ts
+++ b/deps/compliance/commands/test/audit/fix.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { audit } from '@pnpm/deps.compliance.commands'
import { fixtures } from '@pnpm/test-fixtures'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
diff --git a/deps/compliance/commands/test/audit/fixWithUpdate.ts b/deps/compliance/commands/test/audit/fixWithUpdate.ts
index 3072704e88..d8d1f5ce9d 100644
--- a/deps/compliance/commands/test/audit/fixWithUpdate.ts
+++ b/deps/compliance/commands/test/audit/fixWithUpdate.ts
@@ -1,5 +1,6 @@
import { join } from 'node:path'
+import { afterEach, beforeEach, describe, expect, test } from '@jest/globals'
import { audit } from '@pnpm/deps.compliance.commands'
import { readWantedLockfile } from '@pnpm/lockfile.fs'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/deps/compliance/commands/test/audit/ignore.ts b/deps/compliance/commands/test/audit/ignore.ts
index f9327af868..073f161b05 100644
--- a/deps/compliance/commands/test/audit/ignore.ts
+++ b/deps/compliance/commands/test/audit/ignore.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { audit } from '@pnpm/deps.compliance.commands'
import { fixtures } from '@pnpm/test-fixtures'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
diff --git a/deps/compliance/commands/test/audit/index.ts b/deps/compliance/commands/test/audit/index.ts
index f3713e8a00..d3a3627ec0 100644
--- a/deps/compliance/commands/test/audit/index.ts
+++ b/deps/compliance/commands/test/audit/index.ts
@@ -1,6 +1,7 @@
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { afterEach, beforeAll, beforeEach, describe, expect, test } from '@jest/globals'
import { AuditEndpointNotExistsError } from '@pnpm/deps.compliance.audit'
import { audit } from '@pnpm/deps.compliance.commands'
import { install } from '@pnpm/installing.commands'
diff --git a/deps/compliance/commands/test/audit/interactiveFix.ts b/deps/compliance/commands/test/audit/interactiveFix.ts
index 9ffedbf15d..4309114a56 100644
--- a/deps/compliance/commands/test/audit/interactiveFix.ts
+++ b/deps/compliance/commands/test/audit/interactiveFix.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
import chalk from 'chalk'
diff --git a/deps/compliance/commands/test/audit/preserveReferenceOverrides.ts b/deps/compliance/commands/test/audit/preserveReferenceOverrides.ts
index 65b69db2c8..3f45d2c3fe 100644
--- a/deps/compliance/commands/test/audit/preserveReferenceOverrides.ts
+++ b/deps/compliance/commands/test/audit/preserveReferenceOverrides.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { audit } from '@pnpm/deps.compliance.commands'
import { fixtures } from '@pnpm/test-fixtures'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
diff --git a/deps/compliance/commands/test/licenses/index.ts b/deps/compliance/commands/test/licenses/index.ts
index 1b14416db7..6a00a404b9 100644
--- a/deps/compliance/commands/test/licenses/index.ts
+++ b/deps/compliance/commands/test/licenses/index.ts
@@ -3,6 +3,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { licenses } from '@pnpm/deps.compliance.commands'
import { install } from '@pnpm/installing.commands'
diff --git a/deps/compliance/commands/test/sbom/index.ts b/deps/compliance/commands/test/sbom/index.ts
index 0feef888e6..b55d72741c 100644
--- a/deps/compliance/commands/test/sbom/index.ts
+++ b/deps/compliance/commands/test/sbom/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { sbom } from '@pnpm/deps.compliance.commands'
import { install } from '@pnpm/installing.commands'
diff --git a/deps/compliance/license-resolver/package.json b/deps/compliance/license-resolver/package.json
index 6319d42227..7a0ebd6841 100644
--- a/deps/compliance/license-resolver/package.json
+++ b/deps/compliance/license-resolver/package.json
@@ -32,6 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.compliance.license-resolver": "workspace:*"
},
"engines": {
diff --git a/deps/compliance/license-resolver/test/isSpdxLicenseExpression.test.ts b/deps/compliance/license-resolver/test/isSpdxLicenseExpression.test.ts
index 74fe1f04ce..5702cdaf5c 100644
--- a/deps/compliance/license-resolver/test/isSpdxLicenseExpression.test.ts
+++ b/deps/compliance/license-resolver/test/isSpdxLicenseExpression.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { isSpdxLicenseExpression } from '@pnpm/deps.compliance.license-resolver'
describe('isSpdxLicenseExpression', () => {
diff --git a/deps/compliance/license-resolver/test/parseLicenseFromManifest.test.ts b/deps/compliance/license-resolver/test/parseLicenseFromManifest.test.ts
index 520ebdbb12..fb7679fd99 100644
--- a/deps/compliance/license-resolver/test/parseLicenseFromManifest.test.ts
+++ b/deps/compliance/license-resolver/test/parseLicenseFromManifest.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { parseLicenseFromManifest } from '@pnpm/deps.compliance.license-resolver'
describe('parseLicenseFromManifest', () => {
diff --git a/deps/compliance/license-resolver/test/resolveLicense.test.ts b/deps/compliance/license-resolver/test/resolveLicense.test.ts
index 4cc6761ddf..09363c640f 100644
--- a/deps/compliance/license-resolver/test/resolveLicense.test.ts
+++ b/deps/compliance/license-resolver/test/resolveLicense.test.ts
@@ -2,6 +2,7 @@ import { mkdtemp, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { resolveLicense } from '@pnpm/deps.compliance.license-resolver'
async function tempDir (): Promise {
diff --git a/deps/compliance/license-resolver/test/resolveLicenseFromDir.test.ts b/deps/compliance/license-resolver/test/resolveLicenseFromDir.test.ts
index c7db1d990b..09c0e9cee8 100644
--- a/deps/compliance/license-resolver/test/resolveLicenseFromDir.test.ts
+++ b/deps/compliance/license-resolver/test/resolveLicenseFromDir.test.ts
@@ -2,6 +2,7 @@ import { mkdtemp, writeFile } from 'node:fs/promises'
import { tmpdir } from 'node:os'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { resolveLicenseFromDir } from '@pnpm/deps.compliance.license-resolver'
async function tempDir (): Promise {
diff --git a/deps/compliance/license-scanner/test/getPkgInfo.spec.ts b/deps/compliance/license-scanner/test/getPkgInfo.spec.ts
index 151123f50b..f06fbffa4d 100644
--- a/deps/compliance/license-scanner/test/getPkgInfo.spec.ts
+++ b/deps/compliance/license-scanner/test/getPkgInfo.spec.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { afterAll, beforeAll, describe, expect, test } from '@jest/globals'
import type { PackageFilesIndex } from '@pnpm/store.cafs'
import { gitHostedStoreIndexKey, StoreIndex, storeIndexKey } from '@pnpm/store.index'
diff --git a/deps/compliance/license-scanner/test/licenses.spec.ts b/deps/compliance/license-scanner/test/licenses.spec.ts
index a0633519a3..9f457861f0 100644
--- a/deps/compliance/license-scanner/test/licenses.spec.ts
+++ b/deps/compliance/license-scanner/test/licenses.spec.ts
@@ -2,7 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, describe, expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import type { LockfileObject } from '@pnpm/lockfile.fs'
import type { DepPath, ProjectId, ProjectManifest, Registries } from '@pnpm/types'
diff --git a/deps/compliance/sbom/test/getPkgMetadata.test.ts b/deps/compliance/sbom/test/getPkgMetadata.test.ts
index 4643feb306..078accf91e 100644
--- a/deps/compliance/sbom/test/getPkgMetadata.test.ts
+++ b/deps/compliance/sbom/test/getPkgMetadata.test.ts
@@ -2,7 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
-import { describe, expect, it } from '@jest/globals'
+import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'
import type { PackageFilesIndex } from '@pnpm/store.cafs'
import { gitHostedStoreIndexKey, StoreIndex, storeIndexKey } from '@pnpm/store.index'
import type { DepPath } from '@pnpm/types'
diff --git a/deps/graph-hasher/package.json b/deps/graph-hasher/package.json
index 087d95f90b..0033b6ce66 100644
--- a/deps/graph-hasher/package.json
+++ b/deps/graph-hasher/package.json
@@ -41,6 +41,7 @@
"detect-libc": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.graph-hasher": "workspace:*"
},
"engines": {
diff --git a/deps/graph-hasher/test/calcGraphNodeHash.test.ts b/deps/graph-hasher/test/calcGraphNodeHash.test.ts
index 5c74932324..2246bd9738 100644
--- a/deps/graph-hasher/test/calcGraphNodeHash.test.ts
+++ b/deps/graph-hasher/test/calcGraphNodeHash.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { ENGINE_NAME } from '@pnpm/constants'
import { hashObject, hashObjectWithoutSorting } from '@pnpm/crypto.object-hasher'
import { calcGraphNodeHash, type DepsGraph, type DepsStateCache, type PkgMeta } from '@pnpm/deps.graph-hasher'
diff --git a/deps/graph-hasher/test/index.ts b/deps/graph-hasher/test/index.ts
index 18b3ed2a57..3651ee4d94 100644
--- a/deps/graph-hasher/test/index.ts
+++ b/deps/graph-hasher/test/index.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { ENGINE_NAME } from '@pnpm/constants'
import { hashObject, hashObjectWithoutSorting } from '@pnpm/crypto.object-hasher'
import { calcDepState, calcGraphNodeHash } from '@pnpm/deps.graph-hasher'
diff --git a/deps/graph-hasher/test/lockfileToDepGraph.test.ts b/deps/graph-hasher/test/lockfileToDepGraph.test.ts
index e6b8b551a3..e454c44100 100644
--- a/deps/graph-hasher/test/lockfileToDepGraph.test.ts
+++ b/deps/graph-hasher/test/lockfileToDepGraph.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { lockfileToDepGraph } from '@pnpm/deps.graph-hasher'
import type { BinaryResolution } from '@pnpm/resolving.resolver-base'
import type { DepPath } from '@pnpm/types'
diff --git a/deps/graph-sequencer/package.json b/deps/graph-sequencer/package.json
index c2641ab63d..5007dd3f9c 100644
--- a/deps/graph-sequencer/package.json
+++ b/deps/graph-sequencer/package.json
@@ -32,6 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.graph-sequencer": "workspace:*"
},
"engines": {
diff --git a/deps/graph-sequencer/test/index.ts b/deps/graph-sequencer/test/index.ts
index 1b50a85273..633badaa34 100644
--- a/deps/graph-sequencer/test/index.ts
+++ b/deps/graph-sequencer/test/index.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { graphSequencer } from '../src/index.js'
test('graph with three independent self-cycles', () => {
diff --git a/deps/inspection/commands/test/docs.ts b/deps/inspection/commands/test/docs.ts
index 70d9e404c1..5f8350af40 100644
--- a/deps/inspection/commands/test/docs.ts
+++ b/deps/inspection/commands/test/docs.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/deps/inspection/commands/test/listing/index.ts b/deps/inspection/commands/test/listing/index.ts
index 02f5b561c5..aec99aa9b4 100644
--- a/deps/inspection/commands/test/listing/index.ts
+++ b/deps/inspection/commands/test/listing/index.ts
@@ -2,6 +2,7 @@
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { list, why } from '@pnpm/deps.inspection.commands'
import { prepare, preparePackages } from '@pnpm/prepare'
diff --git a/deps/inspection/commands/test/listing/json.ts b/deps/inspection/commands/test/listing/json.ts
index eb7db4b7ac..47f2393379 100644
--- a/deps/inspection/commands/test/listing/json.ts
+++ b/deps/inspection/commands/test/listing/json.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { list } from '@pnpm/deps.inspection.commands'
import { prepare } from '@pnpm/prepare'
diff --git a/deps/inspection/commands/test/listing/recursive.ts b/deps/inspection/commands/test/listing/recursive.ts
index e23b8a0cd1..bb2dd5bc83 100644
--- a/deps/inspection/commands/test/listing/recursive.ts
+++ b/deps/inspection/commands/test/listing/recursive.ts
@@ -1,6 +1,7 @@
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { list, why } from '@pnpm/deps.inspection.commands'
import type { PnpmError } from '@pnpm/error'
import { install } from '@pnpm/installing.commands'
diff --git a/deps/inspection/commands/test/listing/why.ts b/deps/inspection/commands/test/listing/why.ts
index a618977e0d..690f4f6529 100644
--- a/deps/inspection/commands/test/listing/why.ts
+++ b/deps/inspection/commands/test/listing/why.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { why } from '@pnpm/deps.inspection.commands'
import type { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
diff --git a/deps/inspection/commands/test/outdated/index.ts b/deps/inspection/commands/test/outdated/index.ts
index d3c3b7cca0..9dd17799c5 100644
--- a/deps/inspection/commands/test/outdated/index.ts
+++ b/deps/inspection/commands/test/outdated/index.ts
@@ -3,6 +3,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { outdated } from '@pnpm/deps.inspection.commands'
import type { PnpmError } from '@pnpm/error'
diff --git a/deps/inspection/commands/test/outdated/recursive.ts b/deps/inspection/commands/test/outdated/recursive.ts
index f60eec80e7..4c11561345 100644
--- a/deps/inspection/commands/test/outdated/recursive.ts
+++ b/deps/inspection/commands/test/outdated/recursive.ts
@@ -1,6 +1,7 @@
import path from 'node:path'
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { outdated } from '@pnpm/deps.inspection.commands'
import { install } from '@pnpm/installing.commands'
import { preparePackages } from '@pnpm/prepare'
diff --git a/deps/inspection/commands/test/outdated/renderLatest.test.ts b/deps/inspection/commands/test/outdated/renderLatest.test.ts
index b17dc3a8b7..3f584135c5 100644
--- a/deps/inspection/commands/test/outdated/renderLatest.test.ts
+++ b/deps/inspection/commands/test/outdated/renderLatest.test.ts
@@ -1,5 +1,6 @@
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
import { outdated } from '@pnpm/deps.inspection.commands'
import semverDiff from '@pnpm/semver-diff'
import type { PackageManifest } from '@pnpm/types'
diff --git a/deps/inspection/commands/test/view.ts b/deps/inspection/commands/test/view.ts
index 1f6b1da4f7..ce75bcbb5e 100644
--- a/deps/inspection/commands/test/view.ts
+++ b/deps/inspection/commands/test/view.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { Config, ConfigContext } from '@pnpm/config.reader'
import { view } from '@pnpm/deps.inspection.commands'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/deps/inspection/list/package.json b/deps/inspection/list/package.json
index cf203cf711..666cf71f67 100644
--- a/deps/inspection/list/package.json
+++ b/deps/inspection/list/package.json
@@ -48,6 +48,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.inspection.list": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@types/ramda": "catalog:"
diff --git a/deps/inspection/list/test/index.ts b/deps/inspection/list/test/index.ts
index 30c7cab746..65c9e7737e 100644
--- a/deps/inspection/list/test/index.ts
+++ b/deps/inspection/list/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { list, listForPackages } from '@pnpm/deps.inspection.list'
import { fixtures } from '@pnpm/test-fixtures'
import chalk from 'chalk'
diff --git a/deps/inspection/list/test/manyDeps.ts b/deps/inspection/list/test/manyDeps.ts
index 48f52d79c0..695b145433 100644
--- a/deps/inspection/list/test/manyDeps.ts
+++ b/deps/inspection/list/test/manyDeps.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { list } from '@pnpm/deps.inspection.list'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/deps/inspection/list/test/renderDependentsTree.test.ts b/deps/inspection/list/test/renderDependentsTree.test.ts
index 6558498083..f9baed67b0 100644
--- a/deps/inspection/list/test/renderDependentsTree.test.ts
+++ b/deps/inspection/list/test/renderDependentsTree.test.ts
@@ -1,5 +1,6 @@
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { describe, expect, test } from '@jest/globals'
import type { DependentsTree } from '@pnpm/deps.inspection.tree-builder'
import { renderDependentsJson, renderDependentsParseable, renderDependentsTree } from '../lib/renderDependentsTree.js'
diff --git a/deps/inspection/outdated/test/getManifest.spec.ts b/deps/inspection/outdated/test/getManifest.spec.ts
index 41a16dc641..6f58c54b87 100644
--- a/deps/inspection/outdated/test/getManifest.spec.ts
+++ b/deps/inspection/outdated/test/getManifest.spec.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { ResolveFunction } from '@pnpm/installing.client'
import type { PkgResolutionId, TarballResolution } from '@pnpm/resolving.resolver-base'
diff --git a/deps/inspection/outdated/test/outdated.spec.ts b/deps/inspection/outdated/test/outdated.spec.ts
index d11c814e3b..1553df451b 100644
--- a/deps/inspection/outdated/test/outdated.spec.ts
+++ b/deps/inspection/outdated/test/outdated.spec.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/deps/inspection/peers-checker/package.json b/deps/inspection/peers-checker/package.json
index d7667eacd4..70b79d400a 100644
--- a/deps/inspection/peers-checker/package.json
+++ b/deps/inspection/peers-checker/package.json
@@ -43,6 +43,7 @@
"semver-range-intersect": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.inspection.peers-checker": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@types/semver": "catalog:"
diff --git a/deps/inspection/peers-checker/test/checkPeerDependencies.test.ts b/deps/inspection/peers-checker/test/checkPeerDependencies.test.ts
index d9d72827ea..b36199bfbd 100644
--- a/deps/inspection/peers-checker/test/checkPeerDependencies.test.ts
+++ b/deps/inspection/peers-checker/test/checkPeerDependencies.test.ts
@@ -1,4 +1,5 @@
///
+import { expect, test } from '@jest/globals'
import { checkPeerDependencies } from '@pnpm/deps.inspection.peers-checker'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/deps/inspection/tree-builder/package.json b/deps/inspection/tree-builder/package.json
index 4b71bf00c6..226729555e 100644
--- a/deps/inspection/tree-builder/package.json
+++ b/deps/inspection/tree-builder/package.json
@@ -55,6 +55,7 @@
"semver": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/constants": "workspace:*",
"@pnpm/deps.inspection.tree-builder": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
diff --git a/deps/inspection/tree-builder/test/buildDependentsTree.test.ts b/deps/inspection/tree-builder/test/buildDependentsTree.test.ts
index 4b15f7d21d..449c46bf8f 100644
--- a/deps/inspection/tree-builder/test/buildDependentsTree.test.ts
+++ b/deps/inspection/tree-builder/test/buildDependentsTree.test.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { depPathToFilename, refToRelative } from '@pnpm/deps.path'
import type { PackageSnapshots, ProjectSnapshot } from '@pnpm/lockfile.fs'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/deps/inspection/tree-builder/test/createPackagesSearcher.spec.ts b/deps/inspection/tree-builder/test/createPackagesSearcher.spec.ts
index f543e1995f..e566cd011f 100644
--- a/deps/inspection/tree-builder/test/createPackagesSearcher.spec.ts
+++ b/deps/inspection/tree-builder/test/createPackagesSearcher.spec.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { DependencyManifest } from '@pnpm/types'
import { createPackagesSearcher } from '../lib/createPackagesSearcher.js'
diff --git a/deps/inspection/tree-builder/test/getPkgInfo.test.ts b/deps/inspection/tree-builder/test/getPkgInfo.test.ts
index 80d4c5ef9e..feb366ce6e 100644
--- a/deps/inspection/tree-builder/test/getPkgInfo.test.ts
+++ b/deps/inspection/tree-builder/test/getPkgInfo.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { getPkgInfo, type GetPkgInfoOpts } from '../src/getPkgInfo.js'
test('getPkgInfo handles missing pkgSnapshot without crashing', () => {
diff --git a/deps/inspection/tree-builder/test/getTree.test.ts b/deps/inspection/tree-builder/test/getTree.test.ts
index 104420c941..2c64a9c349 100644
--- a/deps/inspection/tree-builder/test/getTree.test.ts
+++ b/deps/inspection/tree-builder/test/getTree.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import type { DependencyNode } from '@pnpm/deps.inspection.tree-builder'
import { refToRelative } from '@pnpm/deps.path'
import type { PackageSnapshots } from '@pnpm/lockfile.fs'
diff --git a/deps/inspection/tree-builder/test/index.ts b/deps/inspection/tree-builder/test/index.ts
index ea6d4a59f9..2f5e165be5 100644
--- a/deps/inspection/tree-builder/test/index.ts
+++ b/deps/inspection/tree-builder/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { buildDependenciesTree, type DependencyNode } from '@pnpm/deps.inspection.tree-builder'
import { depPathToFilename } from '@pnpm/deps.path'
diff --git a/deps/path/package.json b/deps/path/package.json
index 2e7e1e5020..cbe1f2d57c 100644
--- a/deps/path/package.json
+++ b/deps/path/package.json
@@ -38,6 +38,7 @@
"semver": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/deps.path": "workspace:*",
"@types/semver": "catalog:"
},
diff --git a/deps/path/test/index.ts b/deps/path/test/index.ts
index 7f47745bb3..bbb51e4d9d 100644
--- a/deps/path/test/index.ts
+++ b/deps/path/test/index.ts
@@ -1,4 +1,5 @@
///
+import { expect, test } from '@jest/globals'
import {
depPathToFilename,
getPkgIdWithPatchHash,
diff --git a/deps/status/test/assertLockfilesEqual.test.ts b/deps/status/test/assertLockfilesEqual.test.ts
index 4260c73597..3f6302a8cf 100644
--- a/deps/status/test/assertLockfilesEqual.test.ts
+++ b/deps/status/test/assertLockfilesEqual.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import type { LockfileObject } from '@pnpm/lockfile.fs'
import type { ProjectId } from '@pnpm/types'
diff --git a/deps/status/test/checkDepsStatus.test.ts b/deps/status/test/checkDepsStatus.test.ts
index a695eb39e2..b1f37ee9fa 100644
--- a/deps/status/test/checkDepsStatus.test.ts
+++ b/deps/status/test/checkDepsStatus.test.ts
@@ -1,6 +1,6 @@
import type { Stats } from 'node:fs'
-import { jest } from '@jest/globals'
+import { beforeEach, describe, expect, it, jest } from '@jest/globals'
import type { CheckDepsStatusOptions } from '@pnpm/deps.status'
import type { LockfileObject } from '@pnpm/lockfile.fs'
import type { WorkspaceState } from '@pnpm/workspace.state'
diff --git a/deps/status/test/statManifestFile.test.ts b/deps/status/test/statManifestFile.test.ts
index be601c2543..e3a340a66d 100644
--- a/deps/status/test/statManifestFile.test.ts
+++ b/deps/status/test/statManifestFile.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { MANIFEST_BASE_NAMES } from '@pnpm/constants'
import { prepareEmpty } from '@pnpm/prepare'
import { writeProjectManifest } from '@pnpm/workspace.project-manifest-writer'
diff --git a/engine/pm/commands/test/self-updater/selfUpdate.test.ts b/engine/pm/commands/test/self-updater/selfUpdate.test.ts
index a8f36832af..74a4aa2667 100644
--- a/engine/pm/commands/test/self-updater/selfUpdate.test.ts
+++ b/engine/pm/commands/test/self-updater/selfUpdate.test.ts
@@ -2,7 +2,7 @@ import fs from 'node:fs'
import { createRequire } from 'node:module'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { prepare as prepareWithPkg, tempDir } from '@pnpm/prepare'
import { prependDirsToPath } from '@pnpm/shell.path'
diff --git a/engine/pm/commands/test/setup/setup.test.ts b/engine/pm/commands/test/setup/setup.test.ts
index 23cd68f08c..419c6e2b06 100644
--- a/engine/pm/commands/test/setup/setup.test.ts
+++ b/engine/pm/commands/test/setup/setup.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
import type { PathExtenderReport } from '@pnpm/os.env.path-extender'
diff --git a/engine/runtime/commands/test/env/env.test.ts b/engine/runtime/commands/test/env/env.test.ts
index a997330dad..bbab3a88e4 100644
--- a/engine/runtime/commands/test/env/env.test.ts
+++ b/engine/runtime/commands/test/env/env.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
const mockRunPnpmCli = jest.fn()
diff --git a/engine/runtime/commands/test/runtime.test.ts b/engine/runtime/commands/test/runtime.test.ts
index 79f6d982a4..dcf6be67e3 100644
--- a/engine/runtime/commands/test/runtime.test.ts
+++ b/engine/runtime/commands/test/runtime.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
const mockRunPnpmCli = jest.fn()
diff --git a/engine/runtime/node-resolver/package.json b/engine/runtime/node-resolver/package.json
index 2a35accf71..cf4ba4166d 100644
--- a/engine/runtime/node-resolver/package.json
+++ b/engine/runtime/node-resolver/package.json
@@ -43,6 +43,7 @@
"version-selector-type": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/engine.runtime.node-resolver": "workspace:*",
"@pnpm/network.fetch": "workspace:*",
"@types/semver": "catalog:"
diff --git a/engine/runtime/node-resolver/test/getNodeArtifactAddress.test.ts b/engine/runtime/node-resolver/test/getNodeArtifactAddress.test.ts
index 06a6c8739f..06ded0858b 100644
--- a/engine/runtime/node-resolver/test/getNodeArtifactAddress.test.ts
+++ b/engine/runtime/node-resolver/test/getNodeArtifactAddress.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getNodeArtifactAddress } from '../lib/getNodeArtifactAddress.js'
test.each([
diff --git a/engine/runtime/node-resolver/test/getNodeMirror.test.ts b/engine/runtime/node-resolver/test/getNodeMirror.test.ts
index f110a96e45..0de8a9c5ee 100644
--- a/engine/runtime/node-resolver/test/getNodeMirror.test.ts
+++ b/engine/runtime/node-resolver/test/getNodeMirror.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getNodeMirror } from '../lib/getNodeMirror.js'
test.each([
diff --git a/engine/runtime/node-resolver/test/normalizeArch.test.ts b/engine/runtime/node-resolver/test/normalizeArch.test.ts
index e467477ad9..2cacc627a4 100644
--- a/engine/runtime/node-resolver/test/normalizeArch.test.ts
+++ b/engine/runtime/node-resolver/test/normalizeArch.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getNormalizedArch } from '../lib/normalizeArch.js'
test.each([
diff --git a/engine/runtime/node-resolver/test/parseNodeSpecifier.test.ts b/engine/runtime/node-resolver/test/parseNodeSpecifier.test.ts
index 6bb9d7ab55..7e194c55bb 100644
--- a/engine/runtime/node-resolver/test/parseNodeSpecifier.test.ts
+++ b/engine/runtime/node-resolver/test/parseNodeSpecifier.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { parseNodeSpecifier } from '../lib/parseNodeSpecifier.js'
test.each([
diff --git a/engine/runtime/node-resolver/test/resolveNodeVersion.test.ts b/engine/runtime/node-resolver/test/resolveNodeVersion.test.ts
index 7f22657bdf..b8e4da54b9 100644
--- a/engine/runtime/node-resolver/test/resolveNodeVersion.test.ts
+++ b/engine/runtime/node-resolver/test/resolveNodeVersion.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { resolveNodeVersion } from '@pnpm/engine.runtime.node-resolver'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
diff --git a/engine/runtime/node-resolver/test/resolveNodeVersions.test.ts b/engine/runtime/node-resolver/test/resolveNodeVersions.test.ts
index b3aa673345..a66bfc38ed 100644
--- a/engine/runtime/node-resolver/test/resolveNodeVersions.test.ts
+++ b/engine/runtime/node-resolver/test/resolveNodeVersions.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { resolveNodeVersions } from '@pnpm/engine.runtime.node-resolver'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
diff --git a/engine/runtime/system-node-version/test/getSystemNodeVersion.test.ts b/engine/runtime/system-node-version/test/getSystemNodeVersion.test.ts
index 1b943c6640..b9d6df333e 100644
--- a/engine/runtime/system-node-version/test/getSystemNodeVersion.test.ts
+++ b/engine/runtime/system-node-version/test/getSystemNodeVersion.test.ts
@@ -1,5 +1,4 @@
-import { jest } from '@jest/globals'
-
+import { expect, jest, test } from '@jest/globals'
let isSea = false
jest.unstable_mockModule('@pnpm/cli.meta', () => ({
diff --git a/exec/commands/test/create.ts b/exec/commands/test/create.ts
index 3a08ad0830..db6892f0e5 100644
--- a/exec/commands/test/create.ts
+++ b/exec/commands/test/create.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, expect, it, jest } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils/index.js'
@@ -7,7 +7,9 @@ jest.unstable_mockModule('../src/dlx.js', () => ({ handler: jest.fn() }))
const { create, dlx } = await import('../src/index.js')
-beforeEach(() => jest.mocked(dlx.handler).mockClear())
+beforeEach(() => {
+ jest.mocked(dlx.handler).mockClear()
+})
it('throws an error if called without arguments', async () => {
await expect(create.handler({
diff --git a/exec/commands/test/createInstallArgs.test.ts b/exec/commands/test/createInstallArgs.test.ts
index b70426ee12..e350acb777 100644
--- a/exec/commands/test/createInstallArgs.test.ts
+++ b/exec/commands/test/createInstallArgs.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import { createInstallArgs } from '../src/runDepsStatusCheck.js'
describe('createInstallArgs', () => {
diff --git a/exec/commands/test/dlx.createCacheKey.test.ts b/exec/commands/test/dlx.createCacheKey.test.ts
index a44779e710..766c985ed4 100644
--- a/exec/commands/test/dlx.createCacheKey.test.ts
+++ b/exec/commands/test/dlx.createCacheKey.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { createHexHash } from '@pnpm/crypto.hash'
import { createCacheKey } from '../src/dlx.js'
diff --git a/exec/commands/test/dlx.e2e.ts b/exec/commands/test/dlx.e2e.ts
index 5ffb37f80c..5679ecd95e 100644
--- a/exec/commands/test/dlx.e2e.ts
+++ b/exec/commands/test/dlx.e2e.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils/index.js'
diff --git a/exec/commands/test/dlx.ts b/exec/commands/test/dlx.ts
index ef177b8c33..16e66a3bc9 100644
--- a/exec/commands/test/dlx.ts
+++ b/exec/commands/test/dlx.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils/index.js'
@@ -13,7 +13,9 @@ jest.unstable_mockModule('execa', () => ({
const { safeExeca: execa } = await import('execa')
const { dlx } = await import('@pnpm/exec.commands')
-beforeEach(() => jest.mocked(execa).mockClear())
+beforeEach(() => {
+ jest.mocked(execa).mockClear()
+})
test('dlx should work with scoped packages', async () => {
prepareEmpty()
diff --git a/exec/commands/test/exec.e2e.ts b/exec/commands/test/exec.e2e.ts
index 3f84a52213..8291e79ab0 100644
--- a/exec/commands/test/exec.e2e.ts
+++ b/exec/commands/test/exec.e2e.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { exec, run } from '@pnpm/exec.commands'
import { prepare, prepareEmpty, preparePackages } from '@pnpm/prepare'
diff --git a/exec/commands/test/exec.logs.ts b/exec/commands/test/exec.logs.ts
index 58144d498b..d1b5c0d103 100644
--- a/exec/commands/test/exec.logs.ts
+++ b/exec/commands/test/exec.logs.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { writeYamlFile } from 'write-yaml-file'
diff --git a/exec/commands/test/exec.ts b/exec/commands/test/exec.ts
index 32e1b12966..0622017a09 100644
--- a/exec/commands/test/exec.ts
+++ b/exec/commands/test/exec.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { DEFAULT_OPTS } from './utils/index.js'
@@ -11,7 +11,9 @@ jest.unstable_mockModule('execa', () => ({
const { safeExeca: execa } = await import('execa')
const { exec } = await import('@pnpm/exec.commands')
-beforeEach(() => jest.mocked(execa).mockClear())
+beforeEach(() => {
+ jest.mocked(execa).mockClear()
+})
test('exec should set npm_config_user_agent', async () => {
prepareEmpty()
diff --git a/exec/commands/test/index.ts b/exec/commands/test/index.ts
index 8c10ac7c58..96e04fa341 100644
--- a/exec/commands/test/index.ts
+++ b/exec/commands/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import {
restart,
diff --git a/exec/commands/test/makeEnv.test.ts b/exec/commands/test/makeEnv.test.ts
index f283b81ac1..c7006f34a3 100644
--- a/exec/commands/test/makeEnv.test.ts
+++ b/exec/commands/test/makeEnv.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { makeEnv } from '../src/makeEnv.js'
test('makeEnv should fail if prependPaths has a path with a colon', () => {
diff --git a/exec/commands/test/runCompletion.ts b/exec/commands/test/runCompletion.ts
index a2910ef4ee..352bf0229b 100644
--- a/exec/commands/test/runCompletion.ts
+++ b/exec/commands/test/runCompletion.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { run } from '@pnpm/exec.commands'
import { prepare } from '@pnpm/prepare'
diff --git a/exec/commands/test/runRecursive.ts b/exec/commands/test/runRecursive.ts
index de165764af..de9590e768 100644
--- a/exec/commands/test/runRecursive.ts
+++ b/exec/commands/test/runRecursive.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { run } from '@pnpm/exec.commands'
import { preparePackages } from '@pnpm/prepare'
diff --git a/exec/commands/test/testRecursive.ts b/exec/commands/test/testRecursive.ts
index 9b7cb1f385..c14d326393 100644
--- a/exec/commands/test/testRecursive.ts
+++ b/exec/commands/test/testRecursive.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { run } from '@pnpm/exec.commands'
import { preparePackages } from '@pnpm/prepare'
import { createTestIpcServer } from '@pnpm/test-ipc-server'
diff --git a/exec/commands/test/verifyDepsBeforeRun.ts b/exec/commands/test/verifyDepsBeforeRun.ts
index 30da313b04..ca129f6133 100644
--- a/exec/commands/test/verifyDepsBeforeRun.ts
+++ b/exec/commands/test/verifyDepsBeforeRun.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { VerifyDepsBeforeRun } from '@pnpm/config.reader'
import { prepare } from '@pnpm/prepare'
diff --git a/exec/lifecycle/package.json b/exec/lifecycle/package.json
index ac147b2d7d..7e585e538d 100644
--- a/exec/lifecycle/package.json
+++ b/exec/lifecycle/package.json
@@ -53,6 +53,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/exec.lifecycle": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",
diff --git a/exec/lifecycle/test/index.ts b/exec/lifecycle/test/index.ts
index 08905e23e8..c0c45f1d22 100644
--- a/exec/lifecycle/test/index.ts
+++ b/exec/lifecycle/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
import { runLifecycleHook, runLifecycleHooksConcurrently, runPostinstallHooks } from '@pnpm/exec.lifecycle'
import { tempDir } from '@pnpm/prepare'
diff --git a/exec/prepare-package/package.json b/exec/prepare-package/package.json
index cb585297a7..00f89d2e65 100644
--- a/exec/prepare-package/package.json
+++ b/exec/prepare-package/package.json
@@ -41,6 +41,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/exec.prepare-package": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
diff --git a/exec/prepare-package/test/index.ts b/exec/prepare-package/test/index.ts
index 451f62df96..641d3552a2 100644
--- a/exec/prepare-package/test/index.ts
+++ b/exec/prepare-package/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackage } from '@pnpm/exec.prepare-package'
import { tempDir } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/fetching/binary-fetcher/test/index.ts b/fetching/binary-fetcher/test/index.ts
index 2e65d37558..7778b8f7b5 100644
--- a/fetching/binary-fetcher/test/index.ts
+++ b/fetching/binary-fetcher/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
import { createBinaryFetcher, downloadAndUnpackZip } from '@pnpm/fetching.binary-fetcher'
import AdmZip from 'adm-zip'
diff --git a/fetching/directory-fetcher/test/index.ts b/fetching/directory-fetcher/test/index.ts
index 9c213babd6..f6e68efff5 100644
--- a/fetching/directory-fetcher/test/index.ts
+++ b/fetching/directory-fetcher/test/index.ts
@@ -2,7 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeAll, describe, expect, jest, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import { lexCompare } from '@pnpm/util.lex-comparator'
import { rimrafSync } from '@zkochan/rimraf'
diff --git a/fetching/git-fetcher/test/index.ts b/fetching/git-fetcher/test/index.ts
index 18844b0b62..1abd567538 100644
--- a/fetching/git-fetcher/test/index.ts
+++ b/fetching/git-fetcher/test/index.ts
@@ -1,7 +1,7 @@
///
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, beforeEach, expect, jest, test } from '@jest/globals'
import { createCafsStore } from '@pnpm/store.create-cafs-store'
import { StoreIndex } from '@pnpm/store.index'
import { lexCompare } from '@pnpm/util.lex-comparator'
diff --git a/fetching/pick-fetcher/test/customFetch.ts b/fetching/pick-fetcher/test/customFetch.ts
index 508ae22324..185316d54d 100644
--- a/fetching/pick-fetcher/test/customFetch.ts
+++ b/fetching/pick-fetcher/test/customFetch.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, beforeAll, describe, expect, jest, test } from '@jest/globals'
import type { Fetchers, FetchFunction, FetchOptions } from '@pnpm/fetching.fetcher-base'
import { pickFetcher } from '@pnpm/fetching.pick-fetcher'
import { createTarballFetcher } from '@pnpm/fetching.tarball-fetcher'
diff --git a/fetching/pick-fetcher/test/pickFetcher.ts b/fetching/pick-fetcher/test/pickFetcher.ts
index 156de57bf7..fbadbc3768 100644
--- a/fetching/pick-fetcher/test/pickFetcher.ts
+++ b/fetching/pick-fetcher/test/pickFetcher.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import type { Fetchers, FetchFunction } from '@pnpm/fetching.fetcher-base'
import { pickFetcher } from '@pnpm/fetching.pick-fetcher'
import type { CustomFetcher } from '@pnpm/hooks.types'
@@ -49,7 +49,7 @@ test('should fail to pick fetcher if the type is not defined', async () => {
describe('custom fetcher support', () => {
test('should use custom fetcher when canFetch returns true', async () => {
const mockFetchResult = { filesMap: new Map(), manifest: { name: 'test', version: '1.0.0' }, requiresBuild: false }
- const customFetch = jest.fn(async () => mockFetchResult)
+ const customFetch = jest.fn>(async () => mockFetchResult)
const remoteTarball = jest.fn() as FetchFunction
const customFetcher: Partial = {
@@ -88,7 +88,7 @@ describe('custom fetcher support', () => {
test('should use custom fetcher when canFetch returns promise resolving to true', async () => {
const mockFetchResult = { filesMap: new Map(), manifest: { name: 'test', version: '1.0.0' }, requiresBuild: false }
- const customFetch = jest.fn(async () => mockFetchResult)
+ const customFetch = jest.fn>(async () => mockFetchResult)
const customFetcher: Partial = {
canFetch: async () => Promise.resolve(true),
@@ -185,7 +185,7 @@ describe('custom fetcher support', () => {
test('should handle custom resolution types', async () => {
const mockFetchResult = { filesMap: new Map(), manifest: { name: 'test', version: '1.0.0' }, requiresBuild: false }
- const customFetch = jest.fn(async () => mockFetchResult)
+ const customFetch = jest.fn>(async () => mockFetchResult)
const customFetcher: Partial = {
canFetch: (pkgId: string, resolution: any) => resolution.type === 'custom:test', // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -217,7 +217,7 @@ describe('custom fetcher support', () => {
})
test('should pass all fetch options to custom fetcher.fetch', async () => {
- const customFetch = jest.fn(async () => ({ filesMap: new Map(), manifest: { name: 'test', version: '1.0.0' }, requiresBuild: false }))
+ const customFetch = jest.fn>(async () => ({ filesMap: new Map(), manifest: { name: 'test', version: '1.0.0' }, requiresBuild: false }))
const customFetcher: Partial = {
canFetch: () => true,
diff --git a/fetching/tarball-fetcher/test/fetch.ts b/fetching/tarball-fetcher/test/fetch.ts
index efe5999cdf..9d0ad7db58 100644
--- a/fetching/tarball-fetcher/test/fetch.ts
+++ b/fetching/tarball-fetcher/test/fetch.ts
@@ -2,7 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, afterEach, beforeAll, beforeEach, expect, jest, test } from '@jest/globals'
import { FetchError, PnpmError } from '@pnpm/error'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createCafsStore } from '@pnpm/store.create-cafs-store'
diff --git a/fs/hard-link-dir/package.json b/fs/hard-link-dir/package.json
index 811f8f7c65..30634254c2 100644
--- a/fs/hard-link-dir/package.json
+++ b/fs/hard-link-dir/package.json
@@ -41,6 +41,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/fs.hard-link-dir": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*"
diff --git a/fs/hard-link-dir/test/index.ts b/fs/hard-link-dir/test/index.ts
index f7368cbe42..a18432e0fc 100644
--- a/fs/hard-link-dir/test/index.ts
+++ b/fs/hard-link-dir/test/index.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { hardLinkDir } from '@pnpm/fs.hard-link-dir'
import { tempDir as createTempDir } from '@pnpm/prepare'
diff --git a/fs/indexed-pkg-importer/test/createImportPackage.test.ts b/fs/indexed-pkg-importer/test/createImportPackage.test.ts
index 377959dc43..b6107e2bdf 100644
--- a/fs/indexed-pkg-importer/test/createImportPackage.test.ts
+++ b/fs/indexed-pkg-importer/test/createImportPackage.test.ts
@@ -1,8 +1,7 @@
import fs, { type BigIntStats } from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
-
+import { afterAll, beforeEach, expect, jest, test } from '@jest/globals'
const testOnLinuxOnly = (process.platform === 'darwin' || process.platform === 'win32') ? test.skip : test
jest.unstable_mockModule('@pnpm/fs.graceful-fs', () => {
diff --git a/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts b/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts
index 454b905e19..731451019d 100644
--- a/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts
+++ b/fs/indexed-pkg-importer/test/importIndexedDir.race.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { tempDir } from '@pnpm/prepare'
// Mock renameOverwriteSync so we can verify it's called (or not called)
diff --git a/fs/indexed-pkg-importer/test/importIndexedDir.test.ts b/fs/indexed-pkg-importer/test/importIndexedDir.test.ts
index 4ab7dd99db..bc37e236c8 100644
--- a/fs/indexed-pkg-importer/test/importIndexedDir.test.ts
+++ b/fs/indexed-pkg-importer/test/importIndexedDir.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { tempDir } from '@pnpm/prepare'
import { importIndexedDir } from '../src/importIndexedDir.js'
diff --git a/fs/indexed-pkg-importer/test/importingPkgWithInvalidFiles.ts b/fs/indexed-pkg-importer/test/importingPkgWithInvalidFiles.ts
index 31e6f88dd0..189bcc82e4 100644
--- a/fs/indexed-pkg-importer/test/importingPkgWithInvalidFiles.ts
+++ b/fs/indexed-pkg-importer/test/importingPkgWithInvalidFiles.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { createIndexedPkgImporter } from '@pnpm/fs.indexed-pkg-importer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/fs/is-empty-dir-or-nothing/package.json b/fs/is-empty-dir-or-nothing/package.json
index 661dd1e68b..0b8182976e 100644
--- a/fs/is-empty-dir-or-nothing/package.json
+++ b/fs/is-empty-dir-or-nothing/package.json
@@ -31,6 +31,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/fs.is-empty-dir-or-nothing": "workspace:*"
},
"engines": {
diff --git a/fs/is-empty-dir-or-nothing/test/index.test.ts b/fs/is-empty-dir-or-nothing/test/index.test.ts
index 64a2750c65..8fb93eba09 100644
--- a/fs/is-empty-dir-or-nothing/test/index.test.ts
+++ b/fs/is-empty-dir-or-nothing/test/index.test.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { isEmptyDirOrNothing } from '@pnpm/fs.is-empty-dir-or-nothing'
describe('isEmptyDirOrNothing', () => {
diff --git a/fs/symlink-dependency/package.json b/fs/symlink-dependency/package.json
index 62340284dd..2adb4de235 100644
--- a/fs/symlink-dependency/package.json
+++ b/fs/symlink-dependency/package.json
@@ -43,6 +43,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/fs.symlink-dependency": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*"
diff --git a/fs/symlink-dependency/test/symlinkDirectRootDependency.test.ts b/fs/symlink-dependency/test/symlinkDirectRootDependency.test.ts
index 08aaa9a1b1..bcee51d27f 100644
--- a/fs/symlink-dependency/test/symlinkDirectRootDependency.test.ts
+++ b/fs/symlink-dependency/test/symlinkDirectRootDependency.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { symlinkDirectRootDependency } from '@pnpm/fs.symlink-dependency'
import { tempDir } from '@pnpm/prepare'
diff --git a/global/commands/package.json b/global/commands/package.json
index f9ece756a2..4b6389e881 100644
--- a/global/commands/package.json
+++ b/global/commands/package.json
@@ -50,6 +50,7 @@
"symlink-dir": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/global.commands": "workspace:*"
},
"engines": {
diff --git a/global/commands/test/checkGlobalBinConflicts.test.ts b/global/commands/test/checkGlobalBinConflicts.test.ts
index db8e047150..d7fe631422 100644
--- a/global/commands/test/checkGlobalBinConflicts.test.ts
+++ b/global/commands/test/checkGlobalBinConflicts.test.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { checkGlobalBinConflicts } from '@pnpm/global.commands'
import type { DependencyManifest } from '@pnpm/types'
import { symlinkDirSync } from 'symlink-dir'
diff --git a/hooks/pnpmfile/package.json b/hooks/pnpmfile/package.json
index 081c23c5b0..653298e0c2 100644
--- a/hooks/pnpmfile/package.json
+++ b/hooks/pnpmfile/package.json
@@ -45,6 +45,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/fetching.fetcher-base": "workspace:*",
"@pnpm/hooks.pnpmfile": "workspace:*",
"@pnpm/logger": "workspace:*",
diff --git a/hooks/pnpmfile/test/index.ts b/hooks/pnpmfile/test/index.ts
index 51607312f6..6188c719db 100644
--- a/hooks/pnpmfile/test/index.ts
+++ b/hooks/pnpmfile/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { Log } from '@pnpm/core-loggers'
import { BadReadPackageHookError, type HookContext, requireHooks } from '@pnpm/hooks.pnpmfile'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/hooks/read-package-hook/test/createOptionalDependenciesRemover.test.ts b/hooks/read-package-hook/test/createOptionalDependenciesRemover.test.ts
index 3dc9086faa..d6db1852c5 100644
--- a/hooks/read-package-hook/test/createOptionalDependenciesRemover.test.ts
+++ b/hooks/read-package-hook/test/createOptionalDependenciesRemover.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { BaseManifest } from '@pnpm/types'
import { createOptionalDependenciesRemover } from '../lib/createOptionalDependenciesRemover.js'
diff --git a/hooks/read-package-hook/test/createPackageExtender.test.ts b/hooks/read-package-hook/test/createPackageExtender.test.ts
index 62142ed448..19a7da8c07 100644
--- a/hooks/read-package-hook/test/createPackageExtender.test.ts
+++ b/hooks/read-package-hook/test/createPackageExtender.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { createPackageExtender } from '../lib/createPackageExtender.js'
const packageExtender = createPackageExtender({
diff --git a/hooks/read-package-hook/test/createReadPackageHook.ts b/hooks/read-package-hook/test/createReadPackageHook.ts
index e91fbecf59..20e68e42d5 100644
--- a/hooks/read-package-hook/test/createReadPackageHook.ts
+++ b/hooks/read-package-hook/test/createReadPackageHook.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { ReadPackageHook } from '@pnpm/types'
import { createReadPackageHook } from '../lib/createReadPackageHook.js'
diff --git a/hooks/read-package-hook/test/createVersionOverrider.test.ts b/hooks/read-package-hook/test/createVersionOverrider.test.ts
index cae499d06e..f43e66af99 100644
--- a/hooks/read-package-hook/test/createVersionOverrider.test.ts
+++ b/hooks/read-package-hook/test/createVersionOverrider.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { createVersionsOverrider } from '../src/createVersionsOverrider.js'
test('createVersionsOverrider() matches sub-ranges', () => {
diff --git a/hooks/types/test/customResolverCache.test.ts b/hooks/types/test/customResolverCache.test.ts
index 46c67e865b..ec8b2f7b16 100644
--- a/hooks/types/test/customResolverCache.test.ts
+++ b/hooks/types/test/customResolverCache.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import {
checkCustomResolverCanResolve,
type CustomResolver,
diff --git a/installing/client/package.json b/installing/client/package.json
index aef01bd1fb..39943e0d28 100644
--- a/installing/client/package.json
+++ b/installing/client/package.json
@@ -49,6 +49,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/fetching.fetcher-base": "workspace:*",
"@pnpm/installing.client": "workspace:*",
"@types/ramda": "catalog:"
diff --git a/installing/client/test/index.ts b/installing/client/test/index.ts
index de9b8115a8..ddb111b63c 100644
--- a/installing/client/test/index.ts
+++ b/installing/client/test/index.ts
@@ -1,4 +1,5 @@
///
+import { afterAll, expect, test } from '@jest/globals'
import { createClient, createResolver } from '@pnpm/installing.client'
import { StoreIndex } from '@pnpm/store.index'
diff --git a/installing/commands/test/add.ts b/installing/commands/test/add.ts
index 7840e5728f..7ee435c4fc 100644
--- a/installing/commands/test/add.ts
+++ b/installing/commands/test/add.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { add, remove } from '@pnpm/installing.commands'
import { prepare, prepareEmpty, preparePackages } from '@pnpm/prepare'
diff --git a/installing/commands/test/addJsr.ts b/installing/commands/test/addJsr.ts
index 044011f929..422e76c097 100644
--- a/installing/commands/test/addJsr.ts
+++ b/installing/commands/test/addJsr.ts
@@ -1,9 +1,8 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { add } from '@pnpm/installing.commands'
-import type { LockfileFile } from '@pnpm/lockfile.types'
import { prepare } from '@pnpm/prepare'
-import type { ProjectManifest } from '@pnpm/types'
import { loadJsonFileSync } from 'load-json-file'
import { DEFAULT_OPTS } from './utils/index.js'
@@ -34,7 +33,7 @@ test('pnpm add jsr:@/', async () => {
dependencies: {
'@pnpm-e2e/foo': 'jsr:^0.1.0',
},
- } as ProjectManifest)
+ })
expect(project.readLockfile()).toMatchObject({
importers: {
@@ -57,7 +56,7 @@ test('pnpm add jsr:@/', async () => {
snapshots: {
'@jsr/pnpm-e2e__foo@0.1.0': expect.any(Object),
},
- } as Partial)
+ })
})
test('pnpm add jsr:@/ --save-peer writes a valid peer range', async () => {
@@ -75,7 +74,7 @@ test('pnpm add jsr:@/ --save-peer writes a valid peer range', async
peerDependencies: {
'@pnpm-e2e/foo': '^0.1.0',
},
- } as ProjectManifest)
+ })
})
test('pnpm add jsr:@/@latest', async () => {
@@ -91,7 +90,7 @@ test('pnpm add jsr:@/@latest', async () => {
dependencies: {
'@pnpm-e2e/foo': 'jsr:^0.1.0',
},
- } as ProjectManifest)
+ })
expect(project.readLockfile()).toMatchObject({
importers: {
@@ -114,7 +113,7 @@ test('pnpm add jsr:@/@latest', async () => {
snapshots: {
'@jsr/pnpm-e2e__foo@0.1.0': expect.any(Object),
},
- } as Partial)
+ })
})
test('pnpm add jsr:@/@', async () => {
@@ -130,7 +129,7 @@ test('pnpm add jsr:@/@', async () => {
dependencies: {
'@pnpm-e2e/foo': 'jsr:~0.1.0',
},
- } as ProjectManifest)
+ })
expect(project.readLockfile()).toMatchObject({
importers: {
@@ -153,7 +152,7 @@ test('pnpm add jsr:@/@', async () => {
snapshots: {
'@jsr/pnpm-e2e__foo@0.1.0': expect.any(Object),
},
- } as Partial)
+ })
})
test('pnpm add @jsr:@/', async () => {
@@ -169,7 +168,7 @@ test('pnpm add @jsr:@/', async () => {
dependencies: {
'foo-from-jsr': 'jsr:@pnpm-e2e/foo@^0.1.0',
},
- } as ProjectManifest)
+ })
expect(project.readLockfile()).toMatchObject({
importers: {
@@ -192,7 +191,7 @@ test('pnpm add @jsr:@/', async () => {
snapshots: {
'@jsr/pnpm-e2e__foo@0.1.0': expect.any(Object),
},
- } as Partial)
+ })
})
test('pnpm add @jsr:@/@', async () => {
@@ -208,7 +207,7 @@ test('pnpm add @jsr:@/@', async () => {
dependencies: {
'foo-from-jsr': 'jsr:@pnpm-e2e/foo@~0.1.0',
},
- } as ProjectManifest)
+ })
expect(project.readLockfile()).toMatchObject({
importers: {
@@ -231,5 +230,5 @@ test('pnpm add @jsr:@/@', async () => {
snapshots: {
'@jsr/pnpm-e2e__foo@0.1.0': expect.any(Object),
},
- } as Partial)
+ })
})
diff --git a/installing/commands/test/addRecursive.ts b/installing/commands/test/addRecursive.ts
index 327b364aec..f3d4ee2846 100644
--- a/installing/commands/test/addRecursive.ts
+++ b/installing/commands/test/addRecursive.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { add } from '@pnpm/installing.commands'
import type { LockfileObject } from '@pnpm/lockfile.types'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/commands/test/dedupe.ts b/installing/commands/test/dedupe.ts
index 1a645dae65..5a009b115e 100644
--- a/installing/commands/test/dedupe.ts
+++ b/installing/commands/test/dedupe.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { dedupe, install } from '@pnpm/installing.commands'
import { DedupeCheckIssuesError } from '@pnpm/installing.dedupe.check'
import type { LockfileObject } from '@pnpm/lockfile.types'
diff --git a/installing/commands/test/disallowWorkspaceCycles.test.ts b/installing/commands/test/disallowWorkspaceCycles.test.ts
index 8a1980b73a..37f3c60d57 100644
--- a/installing/commands/test/disallowWorkspaceCycles.test.ts
+++ b/installing/commands/test/disallowWorkspaceCycles.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { install } from '@pnpm/installing.commands'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/commands/test/fetch.ts b/installing/commands/test/fetch.ts
index 3d712a53b9..78856c99d7 100644
--- a/installing/commands/test/fetch.ts
+++ b/installing/commands/test/fetch.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { fetch, install } from '@pnpm/installing.commands'
import { prepare } from '@pnpm/prepare'
diff --git a/installing/commands/test/getPinnedVersion.ts b/installing/commands/test/getPinnedVersion.ts
index 4013a9a567..0ed25a05f8 100644
--- a/installing/commands/test/getPinnedVersion.ts
+++ b/installing/commands/test/getPinnedVersion.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getPinnedVersion } from '../lib/getPinnedVersion.js'
test('getPinnedVersion()', () => {
diff --git a/installing/commands/test/getSaveType.ts b/installing/commands/test/getSaveType.ts
index 5a7617d1f5..25c893705f 100644
--- a/installing/commands/test/getSaveType.ts
+++ b/installing/commands/test/getSaveType.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getSaveType } from '../lib/getSaveType.js'
test('getSaveType()', () => {
diff --git a/installing/commands/test/import.ts b/installing/commands/test/import.ts
index dd00595177..c380ff15bb 100644
--- a/installing/commands/test/import.ts
+++ b/installing/commands/test/import.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { PnpmError } from '@pnpm/error'
import { importCommand } from '@pnpm/installing.commands'
diff --git a/installing/commands/test/importRecursive.ts b/installing/commands/test/importRecursive.ts
index cd6d6465d0..a102892d79 100644
--- a/installing/commands/test/importRecursive.ts
+++ b/installing/commands/test/importRecursive.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { importCommand } from '@pnpm/installing.commands'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/commands/test/install.ts b/installing/commands/test/install.ts
index 53ad6b290e..a52d5aaefb 100644
--- a/installing/commands/test/install.ts
+++ b/installing/commands/test/install.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { add, install } from '@pnpm/installing.commands'
import { prepare, prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/commands/test/link.ts b/installing/commands/test/link.ts
index ba90a3b61d..f74b9ec691 100644
--- a/installing/commands/test/link.ts
+++ b/installing/commands/test/link.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { assertProject, isExecutable } from '@pnpm/assert-project'
import { prepare, prepareEmpty, preparePackages } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/installing/commands/test/miscRecursive.ts b/installing/commands/test/miscRecursive.ts
index a561dd19bf..f5619060fa 100644
--- a/installing/commands/test/miscRecursive.ts
+++ b/installing/commands/test/miscRecursive.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { add, install, remove, update } from '@pnpm/installing.commands'
import type { LockfileFile } from '@pnpm/lockfile.types'
diff --git a/installing/commands/test/patchedDependencies.ts b/installing/commands/test/patchedDependencies.ts
index 1d3bb163a9..ec17b8100e 100644
--- a/installing/commands/test/patchedDependencies.ts
+++ b/installing/commands/test/patchedDependencies.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/installing/commands/test/peerDependencies.ts b/installing/commands/test/peerDependencies.ts
index 23b9fcae37..9b5fac2a72 100644
--- a/installing/commands/test/peerDependencies.ts
+++ b/installing/commands/test/peerDependencies.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { add, install } from '@pnpm/installing.commands'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/commands/test/prune.ts b/installing/commands/test/prune.ts
index ae3d995def..35802d5bbe 100644
--- a/installing/commands/test/prune.ts
+++ b/installing/commands/test/prune.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { add, install, prune } from '@pnpm/installing.commands'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/commands/test/remove/completion.ts b/installing/commands/test/remove/completion.ts
index 6cc287bdb7..f7cc265978 100644
--- a/installing/commands/test/remove/completion.ts
+++ b/installing/commands/test/remove/completion.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { remove } from '@pnpm/installing.commands'
import { prepare } from '@pnpm/prepare'
diff --git a/installing/commands/test/remove/remove.ts b/installing/commands/test/remove/remove.ts
index eae973aef7..c5f9480c7e 100644
--- a/installing/commands/test/remove/remove.ts
+++ b/installing/commands/test/remove/remove.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { remove } from '@pnpm/installing.commands'
import { prepare } from '@pnpm/prepare'
diff --git a/installing/commands/test/remove/workspace.ts b/installing/commands/test/remove/workspace.ts
index 3023ccb86e..34f64fe501 100644
--- a/installing/commands/test/remove/workspace.ts
+++ b/installing/commands/test/remove/workspace.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { install, remove } from '@pnpm/installing.commands'
import type { LockfileFile } from '@pnpm/lockfile.types'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/commands/test/saveCatalog.ts b/installing/commands/test/saveCatalog.ts
index f19ff3def9..f2301896eb 100644
--- a/installing/commands/test/saveCatalog.ts
+++ b/installing/commands/test/saveCatalog.ts
@@ -1,8 +1,8 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterEach, expect, test } from '@jest/globals'
import { add } from '@pnpm/installing.commands'
-import type { LockfileFile } from '@pnpm/lockfile.types'
import { prepare, preparePackages } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
@@ -67,7 +67,7 @@ test('saveCatalogName creates new workspace manifest with the new catalogs', asy
resolution: expect.anything(),
},
},
- } as Partial))
+ }))
})
test('saveCatalogName works with different protocols', async () => {
@@ -139,7 +139,7 @@ test('saveCatalogName works with different protocols', async () => {
},
},
},
- } as Partial))
+ }))
})
test('saveCatalogName does not work with local dependencies', async () => {
@@ -220,5 +220,5 @@ test('saveCatalogName with non-default name', async () => {
resolution: expect.anything(),
},
},
- } as Partial))
+ }))
})
diff --git a/installing/commands/test/update/getUpdateChoices.test.ts b/installing/commands/test/update/getUpdateChoices.test.ts
index 26b58c5ea8..c95da43067 100644
--- a/installing/commands/test/update/getUpdateChoices.test.ts
+++ b/installing/commands/test/update/getUpdateChoices.test.ts
@@ -1,5 +1,6 @@
import { stripVTControlCharacters } from 'node:util'
+import { expect, test } from '@jest/globals'
import chalk from 'chalk'
import { getUpdateChoices } from '../../lib/update/getUpdateChoices.js'
diff --git a/installing/commands/test/update/interactive.ts b/installing/commands/test/update/interactive.ts
index 1bd85a874f..4c8a1d3ce0 100644
--- a/installing/commands/test/update/interactive.ts
+++ b/installing/commands/test/update/interactive.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { LockfileObject } from '@pnpm/lockfile.types'
import { prepare, preparePackages } from '@pnpm/prepare'
import { addDistTag, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/commands/test/update/issue-7415.ts b/installing/commands/test/update/issue-7415.ts
index 40e1662b3a..16c1e36fcd 100644
--- a/installing/commands/test/update/issue-7415.ts
+++ b/installing/commands/test/update/issue-7415.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { jest, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { filterProjectsBySelectorObjectsFromDir } from '@pnpm/workspace.projects-filter'
diff --git a/installing/commands/test/update/jsr.ts b/installing/commands/test/update/jsr.ts
index 8e033a9289..27c7957920 100644
--- a/installing/commands/test/update/jsr.ts
+++ b/installing/commands/test/update/jsr.ts
@@ -1,7 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { install, update } from '@pnpm/installing.commands'
-import type { LockfileFile } from '@pnpm/lockfile.types'
import { prepare } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
import type { ProjectManifest } from '@pnpm/types'
@@ -53,7 +53,7 @@ test('jsr without alias', async () => {
snapshots: {
'@jsr/pnpm-e2e__bar@1.0.0': expect.any(Object),
},
- } as Partial)
+ })
await update.handler({
...createOptions(),
@@ -85,7 +85,7 @@ test('jsr without alias', async () => {
snapshots: {
'@jsr/pnpm-e2e__bar@2.0.0': expect.any(Object),
},
- } as Partial)
+ })
})
test('jsr with alias', async () => {
@@ -119,7 +119,7 @@ test('jsr with alias', async () => {
snapshots: {
'@jsr/pnpm-e2e__bar@1.0.0': expect.any(Object),
},
- } as Partial)
+ })
await update.handler({
...createOptions(),
@@ -151,5 +151,5 @@ test('jsr with alias', async () => {
snapshots: {
'@jsr/pnpm-e2e__bar@2.0.0': expect.any(Object),
},
- } as Partial)
+ })
})
diff --git a/installing/commands/test/update/recursive.ts b/installing/commands/test/update/recursive.ts
index 5ca085fd5b..ec4b006555 100644
--- a/installing/commands/test/update/recursive.ts
+++ b/installing/commands/test/update/recursive.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { install, update } from '@pnpm/installing.commands'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
diff --git a/installing/commands/test/update/update.ts b/installing/commands/test/update/update.ts
index 73806588cd..a777792711 100644
--- a/installing/commands/test/update/update.ts
+++ b/installing/commands/test/update/update.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { beforeAll, describe, expect, it, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { install, update } from '@pnpm/installing.commands'
import { prepare, preparePackages } from '@pnpm/prepare'
diff --git a/installing/commands/test/updateWorkspaceDependencies.test.ts b/installing/commands/test/updateWorkspaceDependencies.test.ts
index 2835453da0..eb3f3a93f7 100644
--- a/installing/commands/test/updateWorkspaceDependencies.test.ts
+++ b/installing/commands/test/updateWorkspaceDependencies.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/installing/commands/test/warnCyclicDependencies.ts b/installing/commands/test/warnCyclicDependencies.ts
index 0d4c2dfb2c..ca0b3dd77b 100644
--- a/installing/commands/test/warnCyclicDependencies.ts
+++ b/installing/commands/test/warnCyclicDependencies.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { filterProjectsBySelectorObjectsFromDir } from '@pnpm/workspace.projects-filter'
diff --git a/installing/context/package.json b/installing/context/package.json
index 18cfa6c279..322e23a6a5 100644
--- a/installing/context/package.json
+++ b/installing/context/package.json
@@ -47,6 +47,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.context": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/ramda": "catalog:"
diff --git a/installing/context/test/index.ts b/installing/context/test/index.ts
index 9d8e6a0586..0132d6a269 100644
--- a/installing/context/test/index.ts
+++ b/installing/context/test/index.ts
@@ -3,6 +3,7 @@ import { promises as fs } from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { arrayOfWorkspacePackagesToMap, getContext } from '@pnpm/installing.context'
import type { ProjectId, ProjectRootDir } from '@pnpm/types'
diff --git a/installing/dedupe/check/package.json b/installing/dedupe/check/package.json
index cec407345e..6ff922452c 100644
--- a/installing/dedupe/check/package.json
+++ b/installing/dedupe/check/package.json
@@ -37,6 +37,7 @@
"@pnpm/types": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.dedupe.check": "workspace:*"
},
"engines": {
diff --git a/installing/dedupe/check/test/dedupeDiffCheck.ts b/installing/dedupe/check/test/dedupeDiffCheck.ts
index 82e25f0591..d41f11a86c 100644
--- a/installing/dedupe/check/test/dedupeDiffCheck.ts
+++ b/installing/dedupe/check/test/dedupeDiffCheck.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { DedupeCheckIssuesError, dedupeDiffCheck } from '@pnpm/installing.dedupe.check'
import type { LockfileObject } from '@pnpm/lockfile.types'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/installing/dedupe/issues-renderer/package.json b/installing/dedupe/issues-renderer/package.json
index d65cb48cc4..586605aed3 100644
--- a/installing/dedupe/issues-renderer/package.json
+++ b/installing/dedupe/issues-renderer/package.json
@@ -36,6 +36,7 @@
"chalk": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.dedupe.issues-renderer": "workspace:*"
},
"engines": {
diff --git a/installing/dedupe/issues-renderer/test/index.ts b/installing/dedupe/issues-renderer/test/index.ts
index c0c0bdeb8f..534dd90fd6 100644
--- a/installing/dedupe/issues-renderer/test/index.ts
+++ b/installing/dedupe/issues-renderer/test/index.ts
@@ -1,5 +1,6 @@
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { describe, expect, test } from '@jest/globals'
import { renderDedupeCheckIssues } from '@pnpm/installing.dedupe.issues-renderer'
describe('renderDedupeCheckIssues', () => {
diff --git a/installing/deps-installer/test/api.ts b/installing/deps-installer/test/api.ts
index 491af7c395..fc76ae3ced 100644
--- a/installing/deps-installer/test/api.ts
+++ b/installing/deps-installer/test/api.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import * as pnpm from '@pnpm/installing.deps-installer'
import { testDefaults } from './utils/index.js'
diff --git a/installing/deps-installer/test/breakingChanges.ts b/installing/deps-installer/test/breakingChanges.ts
index ea4930471f..404cfabe2e 100644
--- a/installing/deps-installer/test/breakingChanges.ts
+++ b/installing/deps-installer/test/breakingChanges.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import util from 'node:util'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import type { PnpmError } from '@pnpm/error'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
diff --git a/installing/deps-installer/test/brokenLockfileIntegrity.ts b/installing/deps-installer/test/brokenLockfileIntegrity.ts
index c33c9807ff..61becab3cf 100644
--- a/installing/deps-installer/test/brokenLockfileIntegrity.ts
+++ b/installing/deps-installer/test/brokenLockfileIntegrity.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import {
addDependenciesToPackage,
diff --git a/installing/deps-installer/test/cache.ts b/installing/deps-installer/test/cache.ts
index 3d0ca8bbc7..437f96ae75 100644
--- a/installing/deps-installer/test/cache.ts
+++ b/installing/deps-installer/test/cache.ts
@@ -1,3 +1,4 @@
+import { test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/catalogs.ts b/installing/deps-installer/test/catalogs.ts
index 7f401b7f53..732c6a6a24 100644
--- a/installing/deps-installer/test/catalogs.ts
+++ b/installing/deps-installer/test/catalogs.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import { createPeerDepGraphHash } from '@pnpm/deps.path'
import type { MutatedProject, MutateModulesOptions, ProjectOptions } from '@pnpm/installing.deps-installer'
import type { CatalogSnapshots } from '@pnpm/lockfile.types'
diff --git a/installing/deps-installer/test/checkCompatibility.test.ts b/installing/deps-installer/test/checkCompatibility.test.ts
index 9ed353d8a3..1ea1f56690 100644
--- a/installing/deps-installer/test/checkCompatibility.test.ts
+++ b/installing/deps-installer/test/checkCompatibility.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LAYOUT_VERSION } from '@pnpm/constants'
import { checkCompatibility } from '../lib/install/checkCompatibility/index.js'
diff --git a/installing/deps-installer/test/filterPeerDependencyIssues.test.ts b/installing/deps-installer/test/filterPeerDependencyIssues.test.ts
index fadd92d8cd..59b5b2e0f6 100644
--- a/installing/deps-installer/test/filterPeerDependencyIssues.test.ts
+++ b/installing/deps-installer/test/filterPeerDependencyIssues.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { filterPeerDependencyIssues } from '../src/install/reportPeerDependencyIssues.js'
test('filterPeerDependencyIssues() ignore missing', () => {
diff --git a/installing/deps-installer/test/getPeerDependencyIssues.test.ts b/installing/deps-installer/test/getPeerDependencyIssues.test.ts
index 61178d6d4b..ce3155b057 100644
--- a/installing/deps-installer/test/getPeerDependencyIssues.test.ts
+++ b/installing/deps-installer/test/getPeerDependencyIssues.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { getPeerDependencyIssues } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/installing/deps-installer/test/hoistedNodeLinker/install.ts b/installing/deps-installer/test/hoistedNodeLinker/install.ts
index f43e8e62ca..77595f7bed 100644
--- a/installing/deps-installer/test/hoistedNodeLinker/install.ts
+++ b/installing/deps-installer/test/hoistedNodeLinker/install.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install, mutateModules, mutateModulesInSingleProject } from '@pnpm/installing.deps-installer'
import { prepareEmpty, preparePackages } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/hoistedNodeLinker/uninstall.ts b/installing/deps-installer/test/hoistedNodeLinker/uninstall.ts
index 3ecb911383..233a8c3ecd 100644
--- a/installing/deps-installer/test/hoistedNodeLinker/uninstall.ts
+++ b/installing/deps-installer/test/hoistedNodeLinker/uninstall.ts
@@ -1,8 +1,4 @@
-import { jest } from '@jest/globals'
-import type {
- PackageManifestLog,
- StatsLog,
-} from '@pnpm/core-loggers'
+import { expect, jest, test } from '@jest/globals'
import {
addDependenciesToPackage,
mutateModulesInSingleProject,
@@ -38,13 +34,13 @@ test('uninstall package with no dependencies', async () => {
level: 'debug',
name: 'pnpm:package-manifest',
prefix: process.cwd(),
- } as PackageManifestLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix: process.cwd(),
removed: 1,
- } as StatsLog))
+ }))
/* This should be fixed
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
@@ -54,7 +50,7 @@ test('uninstall package with no dependencies', async () => {
name: 'is-negative',
version: '2.1.0',
},
- } as RootLog))
+ }))
*/
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
@@ -62,7 +58,7 @@ test('uninstall package with no dependencies', async () => {
updated: {
dependencies: {},
},
- } as PackageManifestLog))
+ }))
// uninstall does not remove packages from store
// even if they become unreferenced
diff --git a/installing/deps-installer/test/install/aliases.ts b/installing/deps-installer/test/install/aliases.ts
index 14af45d192..7a38384afa 100644
--- a/installing/deps-installer/test/install/aliases.ts
+++ b/installing/deps-installer/test/install/aliases.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/auth.ts b/installing/deps-installer/test/install/auth.ts
index 12e9fe7370..9411171550 100644
--- a/installing/deps-installer/test/install/auth.ts
+++ b/installing/deps-installer/test/install/auth.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { addUser, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/install/autoInstallPeers.ts b/installing/deps-installer/test/install/autoInstallPeers.ts
index 778fe11ce8..138106a223 100644
--- a/installing/deps-installer/test/install/autoInstallPeers.ts
+++ b/installing/deps-installer/test/install/autoInstallPeers.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { createPeerDepGraphHash } from '@pnpm/deps.path'
import { addDependenciesToPackage, install, mutateModules, mutateModulesInSingleProject, type PackageManifest } from '@pnpm/installing.deps-installer'
diff --git a/installing/deps-installer/test/install/blockExoticSubdeps.ts b/installing/deps-installer/test/install/blockExoticSubdeps.ts
index 87e712ce2d..528d9e0ff8 100644
--- a/installing/deps-installer/test/install/blockExoticSubdeps.ts
+++ b/installing/deps-installer/test/install/blockExoticSubdeps.ts
@@ -1,3 +1,4 @@
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { getMockAgent, setupMockAgent, teardownMockAgent } from '@pnpm/testing.mock-agent'
diff --git a/installing/deps-installer/test/install/bunRuntime.ts b/installing/deps-installer/test/install/bunRuntime.ts
index a90229cccd..a5e3769292 100644
--- a/installing/deps-installer/test/install/bunRuntime.ts
+++ b/installing/deps-installer/test/install/bunRuntime.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/bundledDependencies.ts b/installing/deps-installer/test/install/bundledDependencies.ts
index adb88b9ac6..b180fea691 100644
--- a/installing/deps-installer/test/install/bundledDependencies.ts
+++ b/installing/deps-installer/test/install/bundledDependencies.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/installing/deps-installer/test/install/checkCustomResolverForceResolve.ts b/installing/deps-installer/test/install/checkCustomResolverForceResolve.ts
index f842adcf13..b6fe3db101 100644
--- a/installing/deps-installer/test/install/checkCustomResolverForceResolve.ts
+++ b/installing/deps-installer/test/install/checkCustomResolverForceResolve.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import type { CustomResolver } from '@pnpm/hooks.types'
import type { LockfileObject } from '@pnpm/lockfile.types'
diff --git a/installing/deps-installer/test/install/customResolvers.ts b/installing/deps-installer/test/install/customResolvers.ts
index f808635c91..f5f6a93dd8 100644
--- a/installing/deps-installer/test/install/customResolvers.ts
+++ b/installing/deps-installer/test/install/customResolvers.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { CustomResolver } from '@pnpm/hooks.types'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/dedupe.ts b/installing/deps-installer/test/install/dedupe.ts
index ae96db070e..148d043e42 100644
--- a/installing/deps-installer/test/install/dedupe.ts
+++ b/installing/deps-installer/test/install/dedupe.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/install/dedupeDirectDeps.ts b/installing/deps-installer/test/install/dedupeDirectDeps.ts
index 7559ca86c0..62d2bd480c 100644
--- a/installing/deps-installer/test/install/dedupeDirectDeps.ts
+++ b/installing/deps-installer/test/install/dedupeDirectDeps.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { type MutatedProject, mutateModules } from '@pnpm/installing.deps-installer'
import { preparePackages } from '@pnpm/prepare'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/installing/deps-installer/test/install/dedupeInWorkspace.ts b/installing/deps-installer/test/install/dedupeInWorkspace.ts
index 92ca839b37..31e24cff78 100644
--- a/installing/deps-installer/test/install/dedupeInWorkspace.ts
+++ b/installing/deps-installer/test/install/dedupeInWorkspace.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { type MutatedProject, mutateModules } from '@pnpm/installing.deps-installer'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/deepRecursive.ts b/installing/deps-installer/test/install/deepRecursive.ts
index 7582fa639a..a6134daa3a 100644
--- a/installing/deps-installer/test/install/deepRecursive.ts
+++ b/installing/deps-installer/test/install/deepRecursive.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/defaultPeerDependencies.ts b/installing/deps-installer/test/install/defaultPeerDependencies.ts
index 2d8590c2b3..329c3538d1 100644
--- a/installing/deps-installer/test/install/defaultPeerDependencies.ts
+++ b/installing/deps-installer/test/install/defaultPeerDependencies.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { createPeerDepGraphHash } from '@pnpm/deps.path'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/denoRuntime.ts b/installing/deps-installer/test/install/denoRuntime.ts
index d79782994f..813af3edc6 100644
--- a/installing/deps-installer/test/install/denoRuntime.ts
+++ b/installing/deps-installer/test/install/denoRuntime.ts
@@ -1,3 +1,4 @@
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/errors.ts b/installing/deps-installer/test/install/errors.ts
index c26db2b143..51adf42f1c 100644
--- a/installing/deps-installer/test/install/errors.ts
+++ b/installing/deps-installer/test/install/errors.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { addDependenciesToPackage, mutateModulesInSingleProject } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/excludeLinksFromLockfile.ts b/installing/deps-installer/test/install/excludeLinksFromLockfile.ts
index a6f24627d1..8b809752d8 100644
--- a/installing/deps-installer/test/install/excludeLinksFromLockfile.ts
+++ b/installing/deps-installer/test/install/excludeLinksFromLockfile.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import {
addDependenciesToPackage,
diff --git a/installing/deps-installer/test/install/fixLockfile.ts b/installing/deps-installer/test/install/fixLockfile.ts
index 4333d305cb..d1a32d491e 100644
--- a/installing/deps-installer/test/install/fixLockfile.ts
+++ b/installing/deps-installer/test/install/fixLockfile.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { install, type MutatedProject, mutateModules } from '@pnpm/installing.deps-installer'
import type { LockfileFile, PackageSnapshots } from '@pnpm/lockfile.fs'
diff --git a/installing/deps-installer/test/install/fromRepo.ts b/installing/deps-installer/test/install/fromRepo.ts
index ac5e0beb4f..cc2e5bd3bb 100644
--- a/installing/deps-installer/test/install/fromRepo.ts
+++ b/installing/deps-installer/test/install/fromRepo.ts
@@ -1,9 +1,8 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
-import type { RootLog } from '@pnpm/core-loggers'
import { depPathToFilename } from '@pnpm/deps.path'
import {
addDependenciesToPackage,
@@ -84,7 +83,7 @@ test('from a github repo with different name via named installation', async () =
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
expect(m).toBe('Hi')
@@ -128,7 +127,7 @@ test('from a github repo with different name', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
expect(m).toBe('Hi')
diff --git a/installing/deps-installer/test/install/fromTarball.ts b/installing/deps-installer/test/install/fromTarball.ts
index 70c1a602fb..99f843eb2a 100644
--- a/installing/deps-installer/test/install/fromTarball.ts
+++ b/installing/deps-installer/test/install/fromTarball.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/install/frozenLockfile.ts b/installing/deps-installer/test/install/frozenLockfile.ts
index 4679fcd6bf..718dcedd73 100644
--- a/installing/deps-installer/test/install/frozenLockfile.ts
+++ b/installing/deps-installer/test/install/frozenLockfile.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import {
install,
diff --git a/installing/deps-installer/test/install/gitBranchLockfile.test.ts b/installing/deps-installer/test/install/gitBranchLockfile.test.ts
index 39595bedd9..8aa0cd8a07 100644
--- a/installing/deps-installer/test/install/gitBranchLockfile.test.ts
+++ b/installing/deps-installer/test/install/gitBranchLockfile.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { prepareEmpty, preparePackages } from '@pnpm/prepare'
import type { ProjectManifest, ProjectRootDir } from '@pnpm/types'
diff --git a/installing/deps-installer/test/install/globalVirtualStore.ts b/installing/deps-installer/test/install/globalVirtualStore.ts
index ecd8767fcd..d8e5841418 100644
--- a/installing/deps-installer/test/install/globalVirtualStore.ts
+++ b/installing/deps-installer/test/install/globalVirtualStore.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterAll, expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { install, type MutatedProject, mutateModules, type ProjectOptions } from '@pnpm/installing.deps-installer'
import { prepareEmpty, preparePackages } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/hoist.ts b/installing/deps-installer/test/install/hoist.ts
index ecce49f05f..db262fe624 100644
--- a/installing/deps-installer/test/install/hoist.ts
+++ b/installing/deps-installer/test/install/hoist.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import {
diff --git a/installing/deps-installer/test/install/hooks.ts b/installing/deps-installer/test/install/hooks.ts
index 7340c36076..954a5d636e 100644
--- a/installing/deps-installer/test/install/hooks.ts
+++ b/installing/deps-installer/test/install/hooks.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import {
addDependenciesToPackage,
diff --git a/installing/deps-installer/test/install/ignoredOptionalDependencies.ts b/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
index 01684f876b..e9c795be04 100644
--- a/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
+++ b/installing/deps-installer/test/install/ignoredOptionalDependencies.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
diff --git a/installing/deps-installer/test/install/injectLocalPackages.ts b/installing/deps-installer/test/install/injectLocalPackages.ts
index 23ba71be2d..c4599ab0a9 100644
--- a/installing/deps-installer/test/install/injectLocalPackages.ts
+++ b/installing/deps-installer/test/install/injectLocalPackages.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { type MutatedProject, mutateModules, type ProjectOptions } from '@pnpm/installing.deps-installer'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts b/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts
index 90dcfb19f3..621ab86654 100644
--- a/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts
+++ b/installing/deps-installer/test/install/injectWorkspacePackagesPersistence.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { mutateModules, mutateModulesInSingleProject, type ProjectOptions } from '@pnpm/installing.deps-installer'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/installationChecks.ts b/installing/deps-installer/test/install/installationChecks.ts
index 890449f92e..6993f44f1d 100644
--- a/installing/deps-installer/test/install/installationChecks.ts
+++ b/installing/deps-installer/test/install/installationChecks.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/lifecycleScripts.ts b/installing/deps-installer/test/install/lifecycleScripts.ts
index d1d12ec796..b555bfbd3c 100644
--- a/installing/deps-installer/test/install/lifecycleScripts.ts
+++ b/installing/deps-installer/test/install/lifecycleScripts.ts
@@ -1,9 +1,8 @@
import fs from 'node:fs'
import * as path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
-import type { LifecycleLog } from '@pnpm/core-loggers'
import {
addDependenciesToPackage,
install,
@@ -228,7 +227,7 @@ test("reports child's output", async () => {
name: 'pnpm:lifecycle',
script: 'node postinstall',
stage: 'postinstall',
- } as LifecycleLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
depPath: '@pnpm.e2e/count-to-10@1.0.0',
level: 'debug',
@@ -236,7 +235,7 @@ test("reports child's output", async () => {
name: 'pnpm:lifecycle',
stage: 'postinstall',
stdio: 'stdout',
- } as LifecycleLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
depPath: '@pnpm.e2e/count-to-10@1.0.0',
level: 'debug',
@@ -244,7 +243,7 @@ test("reports child's output", async () => {
name: 'pnpm:lifecycle',
stage: 'postinstall',
stdio: 'stdout',
- } as LifecycleLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
depPath: '@pnpm.e2e/count-to-10@1.0.0',
level: 'debug',
@@ -252,14 +251,14 @@ test("reports child's output", async () => {
name: 'pnpm:lifecycle',
stage: 'postinstall',
stdio: 'stderr',
- } as LifecycleLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
depPath: '@pnpm.e2e/count-to-10@1.0.0',
exitCode: 0,
level: 'debug',
name: 'pnpm:lifecycle',
stage: 'postinstall',
- } as LifecycleLog))
+ }))
})
test("reports child's close event", async () => {
@@ -277,7 +276,7 @@ test("reports child's close event", async () => {
level: 'debug',
name: 'pnpm:lifecycle',
stage: 'postinstall',
- } as LifecycleLog))
+ }))
})
testOnNonWindows('lifecycle scripts have access to node-gyp', async () => {
diff --git a/installing/deps-installer/test/install/local.ts b/installing/deps-installer/test/install/local.ts
index 973ad0ccb6..905ce07e66 100644
--- a/installing/deps-installer/test/install/local.ts
+++ b/installing/deps-installer/test/install/local.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import {
addDependenciesToPackage,
diff --git a/installing/deps-installer/test/install/lockfileDir.ts b/installing/deps-installer/test/install/lockfileDir.ts
index 84a15f919b..ecbb1c3c74 100644
--- a/installing/deps-installer/test/install/lockfileDir.ts
+++ b/installing/deps-installer/test/install/lockfileDir.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage, mutateModulesInSingleProject } from '@pnpm/installing.deps-installer'
import type { LockfileObject } from '@pnpm/lockfile.fs'
diff --git a/installing/deps-installer/test/install/lockfileOnly.ts b/installing/deps-installer/test/install/lockfileOnly.ts
index 9de52e002b..6ccb12164c 100644
--- a/installing/deps-installer/test/install/lockfileOnly.ts
+++ b/installing/deps-installer/test/install/lockfileOnly.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertStore } from '@pnpm/assert-store'
import { ABBREVIATED_META_DIR } from '@pnpm/constants'
import {
diff --git a/installing/deps-installer/test/install/minimumReleaseAge.ts b/installing/deps-installer/test/install/minimumReleaseAge.ts
index 599d8c467b..04c8ea14f7 100644
--- a/installing/deps-installer/test/install/minimumReleaseAge.ts
+++ b/installing/deps-installer/test/install/minimumReleaseAge.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/misc.ts b/installing/deps-installer/test/install/misc.ts
index 1519c7fa81..99ef58605d 100644
--- a/installing/deps-installer/test/install/misc.ts
+++ b/installing/deps-installer/test/install/misc.ts
@@ -1,15 +1,8 @@
import fs from 'node:fs'
import * as path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
-import type {
- PackageManifestLog,
- ProgressLog,
- RootLog,
- StageLog,
- StatsLog,
-} from '@pnpm/core-loggers'
import {
addDependenciesToPackage,
install,
@@ -80,44 +73,44 @@ test('no dependencies (lodash)', async () => {
initial: { name: 'project', version: '0.0.0' },
level: 'debug',
name: 'pnpm:package-manifest',
- } as PackageManifestLog)
+ })
expect(reporter.mock.calls.filter(([arg]) => manifestMatcher.asymmetricMatch(arg))).toHaveLength(1)
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix: process.cwd(),
stage: 'resolution_started',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix: process.cwd(),
stage: 'resolution_done',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix: process.cwd(),
stage: 'importing_started',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix: process.cwd(),
stage: 'importing_done',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: 1,
level: 'debug',
name: 'pnpm:stats',
prefix: process.cwd(),
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix: process.cwd(),
removed: 0,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: expect.objectContaining({
dependencyType: 'prod',
@@ -129,7 +122,7 @@ test('no dependencies (lodash)', async () => {
level: 'debug',
name: 'pnpm:root',
prefix: process.cwd(),
- } as RootLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:package-manifest',
@@ -140,7 +133,7 @@ test('no dependencies (lodash)', async () => {
name: 'project',
version: '0.0.0',
} as ProjectManifest,
- } as PackageManifestLog))
+ }))
const m = project.requireModule('lodash')
expect(typeof m).toBe('function')
@@ -157,7 +150,7 @@ test('only the new packages are added', async () => {
added: 1,
level: 'debug',
name: 'pnpm:stats',
- } as StatsLog))
+ }))
})
test('scoped modules without version spec', async () => {
@@ -242,7 +235,7 @@ test('update a package when installing with a dist-tag', async () => {
name: '@pnpm.e2e/dep-of-pkg-with-1-dep',
version: '100.0.0',
}),
- } as RootLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: expect.objectContaining({
@@ -252,7 +245,7 @@ test('update a package when installing with a dist-tag', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
project.has('@pnpm.e2e/dep-of-pkg-with-1-dep')
project.storeHas('@pnpm.e2e/dep-of-pkg-with-1-dep', '100.1.0')
@@ -305,7 +298,7 @@ test('idempotency', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
reporter.mockClear()
@@ -319,7 +312,7 @@ test('idempotency', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
project.has('@pnpm.e2e/pkg-with-1-dep')
})
@@ -342,7 +335,7 @@ test('reporting adding root package', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
})
test('overwriting (magic-hook@2.0.0 and @0.1.0)', async () => {
@@ -582,7 +575,7 @@ test('should update subdep on second install', async () => {
level: 'debug',
name: 'pnpm:stats',
prefix: process.cwd(),
- } as StatsLog))
+ }))
project.storeHas('@pnpm.e2e/dep-of-pkg-with-1-dep', '100.1.0')
@@ -699,13 +692,13 @@ test('lockfile locks npm dependencies', async () => {
packageId: '@pnpm.e2e/pkg-with-1-dep@100.0.0',
requester: process.cwd(),
status: 'resolved',
- } as ProgressLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
packageId: '@pnpm.e2e/pkg-with-1-dep@100.0.0',
requester: process.cwd(),
status: 'fetched',
- } as ProgressLog))
+ }))
project.storeHas('@pnpm.e2e/dep-of-pkg-with-1-dep', '100.0.0')
@@ -721,13 +714,13 @@ test('lockfile locks npm dependencies', async () => {
packageId: '@pnpm.e2e/pkg-with-1-dep@100.0.0',
requester: process.cwd(),
status: 'resolved',
- } as ProgressLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
packageId: '@pnpm.e2e/pkg-with-1-dep@100.0.0',
requester: process.cwd(),
status: 'found_in_store',
- } as ProgressLog))
+ }))
const m = project.requireModule('.pnpm/@pnpm.e2e+pkg-with-1-dep@100.0.0/node_modules/@pnpm.e2e/dep-of-pkg-with-1-dep/package.json')
@@ -777,7 +770,7 @@ test('install a dependency with * range', async () => {
'@pnpm.e2e/has-beta-only': '*',
},
} as ProjectManifest,
- } as PackageManifestLog))
+ }))
})
test('should throw error when trying to install a package without name', async () => {
diff --git a/installing/deps-installer/test/install/modulesCache.ts b/installing/deps-installer/test/install/modulesCache.ts
index da435e813a..96b06f7ea9 100644
--- a/installing/deps-installer/test/install/modulesCache.ts
+++ b/installing/deps-installer/test/install/modulesCache.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import {
addDependenciesToPackage,
install,
diff --git a/installing/deps-installer/test/install/modulesDir.ts b/installing/deps-installer/test/install/modulesDir.ts
index 8f8a98163e..f5e22d5b9a 100644
--- a/installing/deps-installer/test/install/modulesDir.ts
+++ b/installing/deps-installer/test/install/modulesDir.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { test } from '@jest/globals'
import {
install,
type MutatedProject,
diff --git a/installing/deps-installer/test/install/multipleImporters.ts b/installing/deps-installer/test/install/multipleImporters.ts
index 34cd7cba95..43e7877e28 100644
--- a/installing/deps-installer/test/install/multipleImporters.ts
+++ b/installing/deps-installer/test/install/multipleImporters.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { createPeerDepGraphHash } from '@pnpm/deps.path'
diff --git a/installing/deps-installer/test/install/nodeRuntime.ts b/installing/deps-installer/test/install/nodeRuntime.ts
index 5210ad9f36..94c981f2f7 100644
--- a/installing/deps-installer/test/install/nodeRuntime.ts
+++ b/installing/deps-installer/test/install/nodeRuntime.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/only.ts b/installing/deps-installer/test/install/only.ts
index f24641555c..253b00499f 100644
--- a/installing/deps-installer/test/install/only.ts
+++ b/installing/deps-installer/test/install/only.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/optionalDependencies.ts b/installing/deps-installer/test/install/optionalDependencies.ts
index 068cc52c50..b08b7677e3 100644
--- a/installing/deps-installer/test/install/optionalDependencies.ts
+++ b/installing/deps-installer/test/install/optionalDependencies.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import {
addDependenciesToPackage,
install,
diff --git a/installing/deps-installer/test/install/overrides.ts b/installing/deps-installer/test/install/overrides.ts
index fc172f72be..81ecc4a83e 100644
--- a/installing/deps-installer/test/install/overrides.ts
+++ b/installing/deps-installer/test/install/overrides.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { PnpmError } from '@pnpm/error'
import { addDependenciesToPackage, type MutatedProject, mutateModules, mutateModulesInSingleProject, type ProjectOptions } from '@pnpm/installing.deps-installer'
diff --git a/installing/deps-installer/test/install/packageExtensions.ts b/installing/deps-installer/test/install/packageExtensions.ts
index 073638c04e..259a0eb2eb 100644
--- a/installing/deps-installer/test/install/packageExtensions.ts
+++ b/installing/deps-installer/test/install/packageExtensions.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { hashObject as _hashObject } from '@pnpm/crypto.object-hasher'
import { PnpmError } from '@pnpm/error'
import { addDependenciesToPackage, install, mutateModulesInSingleProject } from '@pnpm/installing.deps-installer'
diff --git a/installing/deps-installer/test/install/patch.ts b/installing/deps-installer/test/install/patch.ts
index b32095581f..d43f434b24 100644
--- a/installing/deps-installer/test/install/patch.ts
+++ b/installing/deps-installer/test/install/patch.ts
@@ -1,9 +1,8 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, expect, jest, test } from '@jest/globals'
import { ENGINE_NAME } from '@pnpm/constants'
-import type { IgnoredScriptsLog } from '@pnpm/core-loggers'
import { createHexHashFromFile } from '@pnpm/crypto.hash'
import { install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
@@ -48,7 +47,7 @@ test('patch package with exact version', async () => {
packageNames: [],
level: 'debug',
name: 'pnpm:ignored-scripts',
- } as IgnoredScriptsLog))
+ }))
expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched')
@@ -144,7 +143,7 @@ test('patch package with version range', async () => {
packageNames: [],
level: 'debug',
name: 'pnpm:ignored-scripts',
- } as IgnoredScriptsLog))
+ }))
expect(fs.readFileSync('node_modules/is-positive/index.js', 'utf8')).toContain('// patched')
diff --git a/installing/deps-installer/test/install/peerDependencies.ts b/installing/deps-installer/test/install/peerDependencies.ts
index 56d21e5aa4..d0398ba067 100644
--- a/installing/deps-installer/test/install/peerDependencies.ts
+++ b/installing/deps-installer/test/install/peerDependencies.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, describe, expect, jest, test } from '@jest/globals'
import type { Project } from '@pnpm/assert-project'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { createPeerDepGraphHash, depPathToFilename } from '@pnpm/deps.path'
diff --git a/installing/deps-installer/test/install/prereleaseWeights.ts b/installing/deps-installer/test/install/prereleaseWeights.ts
index a82463a4a0..dff6ea9b7f 100644
--- a/installing/deps-installer/test/install/prereleaseWeights.ts
+++ b/installing/deps-installer/test/install/prereleaseWeights.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { afterEach, expect, test } from '@jest/globals'
import { type MutatedProject, mutateModules, type MutateModulesOptions, type ProjectOptions } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import type { PackageMeta } from '@pnpm/resolving.registry.types'
diff --git a/installing/deps-installer/test/install/reporting.ts b/installing/deps-installer/test/install/reporting.ts
index d5282ca644..d0237d1dd2 100644
--- a/installing/deps-installer/test/install/reporting.ts
+++ b/installing/deps-installer/test/install/reporting.ts
@@ -1,5 +1,4 @@
-import { jest } from '@jest/globals'
-import type { DeprecationLog } from '@pnpm/core-loggers'
+import { expect, jest, test } from '@jest/globals'
import {
addDependenciesToPackage,
} from '@pnpm/installing.deps-installer'
@@ -19,7 +18,7 @@ test('reports warning when installing deprecated packages', async () => {
level: 'debug',
name: 'pnpm:deprecation',
pkgId: 'express@0.14.1',
- } as DeprecationLog))
+ }))
const lockfile = project.readLockfile()
expect(lockfile.packages['express@0.14.1'].deprecated).toBe('express 0.x series is deprecated')
@@ -31,7 +30,7 @@ test('reports warning when installing deprecated packages', async () => {
expect(reporter).not.toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:deprecation',
- } as DeprecationLog))
+ }))
})
test('doesn\'t report a warning when the deprecated package is allowed', async () => {
@@ -48,5 +47,5 @@ test('doesn\'t report a warning when the deprecated package is allowed', async (
expect(reporter).not.toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:deprecation',
- } as DeprecationLog))
+ }))
})
diff --git a/installing/deps-installer/test/install/resolutionMode.ts b/installing/deps-installer/test/install/resolutionMode.ts
index b37f9274a2..312d9a67b7 100644
--- a/installing/deps-installer/test/install/resolutionMode.ts
+++ b/installing/deps-installer/test/install/resolutionMode.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/install/setExtraNodePath.ts b/installing/deps-installer/test/install/setExtraNodePath.ts
index c80a484ba8..48f753d0ee 100644
--- a/installing/deps-installer/test/install/setExtraNodePath.ts
+++ b/installing/deps-installer/test/install/setExtraNodePath.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import {
install,
type MutatedProject,
diff --git a/installing/deps-installer/test/install/sideEffects.ts b/installing/deps-installer/test/install/sideEffects.ts
index 12fd2389ea..5371e43424 100644
--- a/installing/deps-installer/test/install/sideEffects.ts
+++ b/installing/deps-installer/test/install/sideEffects.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterAll, expect, test } from '@jest/globals'
import { ENGINE_NAME } from '@pnpm/constants'
import { hashObject } from '@pnpm/crypto.object-hasher'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
diff --git a/installing/deps-installer/test/install/stats.ts b/installing/deps-installer/test/install/stats.ts
index fad7c01015..e7783ad099 100644
--- a/installing/deps-installer/test/install/stats.ts
+++ b/installing/deps-installer/test/install/stats.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import {
type MutatedProject,
mutateModules,
diff --git a/installing/deps-installer/test/install/update.ts b/installing/deps-installer/test/install/update.ts
index f976b86714..32fb460dce 100644
--- a/installing/deps-installer/test/install/update.ts
+++ b/installing/deps-installer/test/install/update.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import type { LockfileFile } from '@pnpm/lockfile.fs'
diff --git a/installing/deps-installer/test/install/updatingPkgJson.ts b/installing/deps-installer/test/install/updatingPkgJson.ts
index bdfb7e052d..5f159fd9bb 100644
--- a/installing/deps-installer/test/install/updatingPkgJson.ts
+++ b/installing/deps-installer/test/install/updatingPkgJson.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import {
addDependenciesToPackage,
install,
diff --git a/installing/deps-installer/test/install/validatePeerDependencies.ts b/installing/deps-installer/test/install/validatePeerDependencies.ts
index ec6f679b86..7060510021 100644
--- a/installing/deps-installer/test/install/validatePeerDependencies.ts
+++ b/installing/deps-installer/test/install/validatePeerDependencies.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { install } from '@pnpm/installing.deps-installer'
import { readWantedLockfile } from '@pnpm/lockfile.fs'
import { preparePackages } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/install/virtualStoreDirMaxLength.ts b/installing/deps-installer/test/install/virtualStoreDirMaxLength.ts
index b4de7d7f87..c3b900bd69 100644
--- a/installing/deps-installer/test/install/virtualStoreDirMaxLength.ts
+++ b/installing/deps-installer/test/install/virtualStoreDirMaxLength.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/deps-installer/test/link.ts b/installing/deps-installer/test/link.ts
index 949c858310..8a85d646f1 100644
--- a/installing/deps-installer/test/link.ts
+++ b/installing/deps-installer/test/link.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/installing/deps-installer/test/lockfile.ts b/installing/deps-installer/test/lockfile.ts
index 0e349b0c8b..3d227033c8 100644
--- a/installing/deps-installer/test/lockfile.ts
+++ b/installing/deps-installer/test/lockfile.ts
@@ -1,9 +1,8 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
-import type { RootLog } from '@pnpm/core-loggers'
import type { PnpmError } from '@pnpm/error'
import {
addDependenciesToPackage,
@@ -584,7 +583,7 @@ test('packages are placed in devDependencies even if they are present as non-dev
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: expect.objectContaining({
dependencyType: 'dev',
@@ -593,7 +592,7 @@ test('packages are placed in devDependencies even if they are present as non-dev
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
})
// This testcase verifies that pnpm is not failing when trying to preserve dependencies.
diff --git a/installing/deps-installer/test/offline.ts b/installing/deps-installer/test/offline.ts
index e5b68bcadb..fa69109b2c 100644
--- a/installing/deps-installer/test/offline.ts
+++ b/installing/deps-installer/test/offline.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage, install } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { rimrafSync } from '@zkochan/rimraf'
diff --git a/installing/deps-installer/test/packageImportMethods.ts b/installing/deps-installer/test/packageImportMethods.ts
index 1e64d77444..d440c1c18c 100644
--- a/installing/deps-installer/test/packageImportMethods.ts
+++ b/installing/deps-installer/test/packageImportMethods.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { addDependenciesToPackage } from '@pnpm/installing.deps-installer'
import { prepareEmpty } from '@pnpm/prepare'
import { loadJsonFileSync } from 'load-json-file'
diff --git a/installing/deps-installer/test/prune.ts b/installing/deps-installer/test/prune.ts
index 07f79636c7..87a2e2f920 100644
--- a/installing/deps-installer/test/prune.ts
+++ b/installing/deps-installer/test/prune.ts
@@ -1,7 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
-import type { RootLog } from '@pnpm/core-loggers'
+import { expect, jest, test } from '@jest/globals'
import {
addDependenciesToPackage,
install,
@@ -52,7 +51,7 @@ test('prune removes extraneous packages', async () => {
name: '@pnpm.e2e/hello-world-js-bin',
version: '1.0.0',
}),
- } as RootLog))
+ }))
project.hasNot('@pnpm.e2e/hello-world-js-bin') // external link pruned
diff --git a/installing/deps-installer/test/uninstall.ts b/installing/deps-installer/test/uninstall.ts
index c90efd2995..0954eee21e 100644
--- a/installing/deps-installer/test/uninstall.ts
+++ b/installing/deps-installer/test/uninstall.ts
@@ -1,13 +1,8 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
-import type {
- PackageManifestLog,
- RootLog,
- StatsLog,
-} from '@pnpm/core-loggers'
import {
addDependenciesToPackage,
mutateModules,
@@ -49,13 +44,13 @@ test('uninstall package with no dependencies', async () => {
level: 'debug',
name: 'pnpm:package-manifest',
prefix: process.cwd(),
- } as PackageManifestLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix: process.cwd(),
removed: 1,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:root',
@@ -64,14 +59,14 @@ test('uninstall package with no dependencies', async () => {
name: 'is-negative',
version: '2.1.0',
}),
- } as RootLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:package-manifest',
updated: {
dependencies: {},
},
- } as PackageManifestLog))
+ }))
// uninstall does not remove packages from store
// even if they become unreferenced
@@ -99,7 +94,7 @@ test('uninstall a dependency that is not present in node_modules', async () => {
removed: expect.objectContaining({
name: 'is-negative',
}),
- } as RootLog))
+ }))
})
test('uninstall scoped package', async () => {
diff --git a/installing/deps-resolver/package.json b/installing/deps-resolver/package.json
index aa555d3ed8..6da0ddd14f 100644
--- a/installing/deps-resolver/package.json
+++ b/installing/deps-resolver/package.json
@@ -76,6 +76,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.deps-resolver": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/normalize-path": "catalog:",
diff --git a/installing/deps-resolver/test/dedupeDepPaths.test.ts b/installing/deps-resolver/test/dedupeDepPaths.test.ts
index ffdf64a282..d4d31b39b6 100644
--- a/installing/deps-resolver/test/dedupeDepPaths.test.ts
+++ b/installing/deps-resolver/test/dedupeDepPaths.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PkgIdWithPatchHash, PkgResolutionId, ProjectRootDir } from '@pnpm/types'
import type { NodeId } from '../lib/nextNodeId.js'
diff --git a/installing/deps-resolver/test/getManifestFromResponse.test.ts b/installing/deps-resolver/test/getManifestFromResponse.test.ts
index 5ea4806df7..067489a8be 100644
--- a/installing/deps-resolver/test/getManifestFromResponse.test.ts
+++ b/installing/deps-resolver/test/getManifestFromResponse.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PackageResponse } from '@pnpm/store.controller-types'
import { getManifestFromResponse, type WantedDependency } from '../lib/resolveDependencies.js'
diff --git a/installing/deps-resolver/test/hoistPeers.test.ts b/installing/deps-resolver/test/hoistPeers.test.ts
index f90d482750..af35c865ce 100644
--- a/installing/deps-resolver/test/hoistPeers.test.ts
+++ b/installing/deps-resolver/test/hoistPeers.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getHoistableOptionalPeers, hoistPeers } from '../lib/hoistPeers.js'
test('hoistPeers picks an already available prerelease version', () => {
diff --git a/installing/deps-resolver/test/linkPathToPeerVersion.test.ts b/installing/deps-resolver/test/linkPathToPeerVersion.test.ts
index 68a8e7c09c..b3e9733814 100644
--- a/installing/deps-resolver/test/linkPathToPeerVersion.test.ts
+++ b/installing/deps-resolver/test/linkPathToPeerVersion.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { linkPathToPeerVersion } from '../lib/linkPathToPeerVersion.js'
// These outputs are lockfile-format: changing any of them breaks existing
diff --git a/installing/deps-resolver/test/parentIdsContainSequence.test.ts b/installing/deps-resolver/test/parentIdsContainSequence.test.ts
index 0493a0c699..2806bdff30 100644
--- a/installing/deps-resolver/test/parentIdsContainSequence.test.ts
+++ b/installing/deps-resolver/test/parentIdsContainSequence.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PkgResolutionId } from '@pnpm/types'
import { parentIdsContainSequence } from '../lib/parentIdsContainSequence.js'
diff --git a/installing/deps-resolver/test/replaceVersionInPref.test.ts b/installing/deps-resolver/test/replaceVersionInPref.test.ts
index d057dc2de7..3e67cf3b92 100644
--- a/installing/deps-resolver/test/replaceVersionInPref.test.ts
+++ b/installing/deps-resolver/test/replaceVersionInPref.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { replaceVersionInBareSpecifier } from '../lib/replaceVersionInBareSpecifier.js'
test('replaceVersionInBareSpecifier()', () => {
diff --git a/installing/deps-resolver/test/resolvePeers.ts b/installing/deps-resolver/test/resolvePeers.ts
index fbcba3a813..c7446f44af 100644
--- a/installing/deps-resolver/test/resolvePeers.ts
+++ b/installing/deps-resolver/test/resolvePeers.ts
@@ -1,4 +1,5 @@
///
+import { beforeAll, describe, expect, it, test } from '@jest/globals'
import type {
PeerDependencyIssuesByProjects,
PkgIdWithPatchHash,
diff --git a/installing/deps-resolver/test/unwrapPackageName.test.ts b/installing/deps-resolver/test/unwrapPackageName.test.ts
index cd6433db1d..b94c6a96c2 100644
--- a/installing/deps-resolver/test/unwrapPackageName.test.ts
+++ b/installing/deps-resolver/test/unwrapPackageName.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { unwrapPackageName } from '../lib/unwrapPackageName.js'
test('works for wanted dependency with no alias', () => {
diff --git a/installing/deps-resolver/test/validatePeerDependencies.test.ts b/installing/deps-resolver/test/validatePeerDependencies.test.ts
index e23ec2b858..dcf8808547 100644
--- a/installing/deps-resolver/test/validatePeerDependencies.test.ts
+++ b/installing/deps-resolver/test/validatePeerDependencies.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { validatePeerDependencies } from '../src/validatePeerDependencies.js'
test('accepts valid specifications that make sense for peerDependencies', () => {
diff --git a/installing/deps-restorer/test/index.ts b/installing/deps-restorer/test/index.ts
index e7b646c12f..518d40a1e1 100644
--- a/installing/deps-restorer/test/index.ts
+++ b/installing/deps-restorer/test/index.ts
@@ -2,15 +2,9 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { ENGINE_NAME, WANTED_LOCKFILE } from '@pnpm/constants'
-import type {
- PackageManifestLog,
- RootLog,
- StageLog,
- StatsLog,
-} from '@pnpm/core-loggers'
import { hashObject } from '@pnpm/crypto.object-hasher'
import { headlessInstall } from '@pnpm/installing.deps-restorer'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
@@ -87,25 +81,25 @@ test('installing a simple project', async () => {
level: 'debug',
name: 'pnpm:package-manifest',
updated: loadJsonFileSync(path.join(prefix, 'package.json')),
- } as PackageManifestLog)
+ })
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: 15,
level: 'debug',
name: 'pnpm:stats',
prefix,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix,
removed: 0,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix,
stage: 'importing_done',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
packageId: 'is-negative@2.1.0',
@@ -125,7 +119,7 @@ test('installing a simple project', async () => {
level: 'debug',
name: 'pnpm:stats',
prefix,
- } as StatsLog))
+ }))
})
test('installing only prod deps', async () => {
@@ -284,7 +278,7 @@ test('installing non-prod deps then all deps', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
expect(reporter).not.toHaveBeenCalledWith(expect.objectContaining({
added: expect.objectContaining({
dependencyType: 'dev',
@@ -293,7 +287,7 @@ test('installing non-prod deps then all deps', async () => {
}),
level: 'debug',
name: 'pnpm:root',
- } as RootLog))
+ }))
project.has('once')
@@ -426,7 +420,7 @@ test('orphan packages are removed', async () => {
name: 'pnpm:stats',
prefix: projectDir,
removed: 1,
- } as StatsLog))
+ }))
const project = assertProject(projectDir)
project.hasNot('resolve-from')
@@ -600,25 +594,25 @@ test('installing with hoistPattern=*', async () => {
name: 'simple-shamefully-flatten',
version: '1.0.0',
}),
- } as PackageManifestLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: 17,
level: 'debug',
name: 'pnpm:stats',
prefix,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix,
removed: 0,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix,
stage: 'importing_done',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
packageId: 'is-negative@2.1.0',
@@ -661,26 +655,26 @@ test('installing with publicHoistPattern=*', async () => {
level: 'debug',
name: 'pnpm:package-manifest',
updated: loadJsonFileSync(path.join(prefix, 'package.json')),
- } as PackageManifestLog)
+ })
}
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
added: 17,
level: 'debug',
name: 'pnpm:stats',
prefix,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stats',
prefix,
removed: 0,
- } as StatsLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
name: 'pnpm:stage',
prefix,
stage: 'importing_done',
- } as StageLog))
+ }))
expect(reporter).toHaveBeenCalledWith(expect.objectContaining({
level: 'debug',
packageId: 'is-negative@2.1.0',
diff --git a/installing/env-installer/package.json b/installing/env-installer/package.json
index c197efc883..e08f923996 100644
--- a/installing/env-installer/package.json
+++ b/installing/env-installer/package.json
@@ -62,6 +62,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.env-installer": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/registry-mock": "catalog:",
diff --git a/installing/env-installer/test/installConfigDeps.ts b/installing/env-installer/test/installConfigDeps.ts
index 3b9a2db0de..28c0bf6c83 100644
--- a/installing/env-installer/test/installConfigDeps.ts
+++ b/installing/env-installer/test/installConfigDeps.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { installConfigDeps } from '@pnpm/installing.env-installer'
import { createEnvLockfile, type EnvLockfile, readEnvLockfile } from '@pnpm/lockfile.fs'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/env-installer/test/resolveAndInstallConfigDeps.test.ts b/installing/env-installer/test/resolveAndInstallConfigDeps.test.ts
index e63d6b26e5..c8c56920d4 100644
--- a/installing/env-installer/test/resolveAndInstallConfigDeps.test.ts
+++ b/installing/env-installer/test/resolveAndInstallConfigDeps.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { resolveAndInstallConfigDeps } from '@pnpm/installing.env-installer'
import { createEnvLockfile, readEnvLockfile, writeEnvLockfile } from '@pnpm/lockfile.fs'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/env-installer/test/resolveConfigDeps.test.ts b/installing/env-installer/test/resolveConfigDeps.test.ts
index 6d5621b9bf..7be11b8509 100644
--- a/installing/env-installer/test/resolveConfigDeps.test.ts
+++ b/installing/env-installer/test/resolveConfigDeps.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { resolveConfigDeps } from '@pnpm/installing.env-installer'
import { readEnvLockfile } from '@pnpm/lockfile.fs'
import { prepareEmpty } from '@pnpm/prepare'
diff --git a/installing/linking/real-hoist/package.json b/installing/linking/real-hoist/package.json
index a6e3f46508..561b4c32d1 100644
--- a/installing/linking/real-hoist/package.json
+++ b/installing/linking/real-hoist/package.json
@@ -38,6 +38,7 @@
"@yarnpkg/nm": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.linking.real-hoist": "workspace:*",
"@pnpm/lockfile.fs": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
diff --git a/installing/linking/real-hoist/test/index.ts b/installing/linking/real-hoist/test/index.ts
index af79e4026d..a686e99631 100644
--- a/installing/linking/real-hoist/test/index.ts
+++ b/installing/linking/real-hoist/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { hoist } from '@pnpm/installing.linking.real-hoist'
import { readWantedLockfile } from '@pnpm/lockfile.fs'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/installing/modules-yaml/package.json b/installing/modules-yaml/package.json
index da0d08e9c4..211e8c6ef4 100644
--- a/installing/modules-yaml/package.json
+++ b/installing/modules-yaml/package.json
@@ -40,6 +40,7 @@
"read-yaml-file": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.modules-yaml": "workspace:*",
"@types/is-windows": "catalog:",
"@types/ramda": "catalog:",
diff --git a/installing/modules-yaml/test/index.ts b/installing/modules-yaml/test/index.ts
index ba2d217685..126505b16a 100644
--- a/installing/modules-yaml/test/index.ts
+++ b/installing/modules-yaml/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readModulesManifest, type StrictModules, writeModulesManifest } from '@pnpm/installing.modules-yaml'
import isWindows from 'is-windows'
import { readYamlFileSync } from 'read-yaml-file'
@@ -41,7 +42,7 @@ test('writeModulesManifest() and readModulesManifest()', async () => {
test('backward compatible read of .modules.yaml created with shamefully-hoist=true', async () => {
const modulesYaml = await readModulesManifest(path.join(import.meta.dirname, 'fixtures/old-shamefully-hoist'))
if (modulesYaml == null) {
- fail('modulesYaml was nullish')
+ throw new Error('modulesYaml was nullish')
}
expect(modulesYaml.publicHoistPattern).toEqual(['*'])
expect(modulesYaml.hoistedDependencies).toEqual({
@@ -54,7 +55,7 @@ test('backward compatible read of .modules.yaml created with shamefully-hoist=tr
test('backward compatible read of .modules.yaml created with shamefully-hoist=false', async () => {
const modulesYaml = await readModulesManifest(path.join(import.meta.dirname, 'fixtures/old-no-shamefully-hoist'))
if (modulesYaml == null) {
- fail('modulesYaml was nullish')
+ throw new Error('modulesYaml was nullish')
}
expect(modulesYaml.publicHoistPattern).toEqual([])
expect(modulesYaml.hoistedDependencies).toEqual({
diff --git a/installing/package-requester/test/index.ts b/installing/package-requester/test/index.ts
index 8d91505cf1..f87de972f3 100644
--- a/installing/package-requester/test/index.ts
+++ b/installing/package-requester/test/index.ts
@@ -2,7 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterAll, afterEach, expect, jest, test } from '@jest/globals'
import { depPathToFilename } from '@pnpm/deps.path'
import { createClient } from '@pnpm/installing.client'
import { createPackageRequester, type PackageResponse } from '@pnpm/installing.package-requester'
diff --git a/lockfile/filtering/test/filterByImporters.ts b/lockfile/filtering/test/filterByImporters.ts
index f8f12d62a3..9a29685f61 100644
--- a/lockfile/filtering/test/filterByImporters.ts
+++ b/lockfile/filtering/test/filterByImporters.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { filterLockfileByImporters } from '@pnpm/lockfile.filtering'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/lockfile/filtering/test/filterByImportersAndEngine.ts b/lockfile/filtering/test/filterByImportersAndEngine.ts
index 59ccb2d956..9ac269a4d2 100644
--- a/lockfile/filtering/test/filterByImportersAndEngine.ts
+++ b/lockfile/filtering/test/filterByImportersAndEngine.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/lockfile/fs/test/gitBranchLockfile.test.ts b/lockfile/fs/test/gitBranchLockfile.test.ts
index fb15fe864b..2d598c1bee 100644
--- a/lockfile/fs/test/gitBranchLockfile.test.ts
+++ b/lockfile/fs/test/gitBranchLockfile.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { getGitBranchLockfileNames } from '../lib/gitBranchLockfile.js'
process.chdir(import.meta.dirname)
diff --git a/lockfile/fs/test/lockfileName.test.ts b/lockfile/fs/test/lockfileName.test.ts
index 2754bea6c2..9f3a5a46d7 100644
--- a/lockfile/fs/test/lockfileName.test.ts
+++ b/lockfile/fs/test/lockfileName.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { afterEach, describe, expect, jest, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
jest.unstable_mockModule('@pnpm/network.git-utils', () => ({ getCurrentBranch: jest.fn() }))
diff --git a/lockfile/fs/test/lockfileV6Converters.test.ts b/lockfile/fs/test/lockfileV6Converters.test.ts
index dfae5a6aec..25f5e94fcd 100644
--- a/lockfile/fs/test/lockfileV6Converters.test.ts
+++ b/lockfile/fs/test/lockfileV6Converters.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { convertToLockfileFile, convertToLockfileObject } from '../lib/lockfileFormatConverters.js'
test('convertToLockfileFile()', () => {
diff --git a/lockfile/fs/test/normalizeLockfile.test.ts b/lockfile/fs/test/normalizeLockfile.test.ts
index e700e360d4..95c03a35c7 100644
--- a/lockfile/fs/test/normalizeLockfile.test.ts
+++ b/lockfile/fs/test/normalizeLockfile.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import type { ProjectId } from '@pnpm/types'
diff --git a/lockfile/fs/test/read.test.ts b/lockfile/fs/test/read.test.ts
index 324fd40587..ab7a013c26 100644
--- a/lockfile/fs/test/read.test.ts
+++ b/lockfile/fs/test/read.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { DepPath, ProjectId } from '@pnpm/types'
import { temporaryDirectory } from 'tempy'
@@ -40,15 +40,12 @@ test('readWantedLockfile()', async () => {
})
}
- try {
- await readWantedLockfile(path.join('fixtures', '3'), {
+ await expect(
+ readWantedLockfile(path.join('fixtures', '3'), {
ignoreIncompatible: false,
wantedVersions: ['3'],
})
- fail()
- } catch (err: any) { // eslint-disable-line
- expect(err.code).toBe('ERR_PNPM_LOCKFILE_BREAKING_CHANGE')
- }
+ ).rejects.toMatchObject({ code: 'ERR_PNPM_LOCKFILE_BREAKING_CHANGE' })
})
test('readWantedLockfile() when lockfileVersion is a string', async () => {
diff --git a/lockfile/fs/test/sortLockfileKeys.test.ts b/lockfile/fs/test/sortLockfileKeys.test.ts
index 48601d32fd..2cef041070 100644
--- a/lockfile/fs/test/sortLockfileKeys.test.ts
+++ b/lockfile/fs/test/sortLockfileKeys.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { sortLockfileKeys } from '../lib/sortLockfileKeys.js'
diff --git a/lockfile/fs/test/write.test.ts b/lockfile/fs/test/write.test.ts
index 0c1ec6dd1b..a6ed6183f3 100644
--- a/lockfile/fs/test/write.test.ts
+++ b/lockfile/fs/test/write.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import type { ProjectId } from '@pnpm/types'
import { temporaryDirectory } from 'tempy'
diff --git a/lockfile/fs/test/yamlDocuments.test.ts b/lockfile/fs/test/yamlDocuments.test.ts
index 05716d4fa8..0720a34a6a 100644
--- a/lockfile/fs/test/yamlDocuments.test.ts
+++ b/lockfile/fs/test/yamlDocuments.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { temporaryDirectory } from 'tempy'
import {
diff --git a/lockfile/make-dedicated-lockfile/package.json b/lockfile/make-dedicated-lockfile/package.json
index 5e2dcea449..f21f54144c 100644
--- a/lockfile/make-dedicated-lockfile/package.json
+++ b/lockfile/make-dedicated-lockfile/package.json
@@ -47,6 +47,7 @@
"rename-overwrite": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/lockfile.make-dedicated-lockfile": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@types/ramda": "catalog:",
diff --git a/lockfile/make-dedicated-lockfile/test/index.ts b/lockfile/make-dedicated-lockfile/test/index.ts
index 8657636e06..a23ae47bbc 100644
--- a/lockfile/make-dedicated-lockfile/test/index.ts
+++ b/lockfile/make-dedicated-lockfile/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readWantedLockfile } from '@pnpm/lockfile.fs'
import { fixtures } from '@pnpm/test-fixtures'
import { safeExeca as execa } from 'execa'
diff --git a/lockfile/merger/package.json b/lockfile/merger/package.json
index 5b7cbe24a4..4fed3a837b 100644
--- a/lockfile/merger/package.json
+++ b/lockfile/merger/package.json
@@ -40,6 +40,7 @@
"semver": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/lockfile.merger": "workspace:*",
"@types/ramda": "catalog:",
"@types/semver": "catalog:"
diff --git a/lockfile/merger/test/index.ts b/lockfile/merger/test/index.ts
index 531dd1a675..de1fdaa9f9 100644
--- a/lockfile/merger/test/index.ts
+++ b/lockfile/merger/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { LockfileObject } from '@pnpm/lockfile.types'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/lockfile/pruner/package.json b/lockfile/pruner/package.json
index 9817666b8a..6a8beb86b5 100644
--- a/lockfile/pruner/package.json
+++ b/lockfile/pruner/package.json
@@ -40,6 +40,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/lockfile.pruner": "workspace:*",
"@types/ramda": "catalog:",
"yaml-tag": "catalog:"
diff --git a/lockfile/pruner/test/index.ts b/lockfile/pruner/test/index.ts
index 4f89fb862f..be77f42087 100644
--- a/lockfile/pruner/test/index.ts
+++ b/lockfile/pruner/test/index.ts
@@ -1,4 +1,5 @@
///
+import { expect, test } from '@jest/globals'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import {
pruneLockfile,
diff --git a/lockfile/to-pnp/package.json b/lockfile/to-pnp/package.json
index 6223732a1f..cd630f31a2 100644
--- a/lockfile/to-pnp/package.json
+++ b/lockfile/to-pnp/package.json
@@ -45,6 +45,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/lockfile.to-pnp": "workspace:*",
"@pnpm/logger": "workspace:*",
"@types/normalize-path": "catalog:",
diff --git a/lockfile/to-pnp/test/index.ts b/lockfile/to-pnp/test/index.ts
index 352f3e2537..baf308c833 100644
--- a/lockfile/to-pnp/test/index.ts
+++ b/lockfile/to-pnp/test/index.ts
@@ -1,6 +1,7 @@
// cspell:ignore haspeer
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { lockfileToPackageRegistry } from '@pnpm/lockfile.to-pnp'
import type { DepPath, ProjectId } from '@pnpm/types'
diff --git a/lockfile/utils/package.json b/lockfile/utils/package.json
index 5ec274d775..71c444edb4 100644
--- a/lockfile/utils/package.json
+++ b/lockfile/utils/package.json
@@ -44,6 +44,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/lockfile.utils": "workspace:*",
"@types/ramda": "catalog:",
"tempy": "catalog:",
diff --git a/lockfile/utils/test/nameVerFromPkgSnapshot.ts b/lockfile/utils/test/nameVerFromPkgSnapshot.ts
index ae5168f26d..1c8d25be23 100644
--- a/lockfile/utils/test/nameVerFromPkgSnapshot.ts
+++ b/lockfile/utils/test/nameVerFromPkgSnapshot.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { nameVerFromPkgSnapshot } from '@pnpm/lockfile.utils'
test('nameVerFromPkgSnapshot()', () => {
diff --git a/lockfile/utils/test/pkgSnapshotToResolution.ts b/lockfile/utils/test/pkgSnapshotToResolution.ts
index bfb34f65df..14ed9ab574 100644
--- a/lockfile/utils/test/pkgSnapshotToResolution.ts
+++ b/lockfile/utils/test/pkgSnapshotToResolution.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { pkgSnapshotToResolution } from '@pnpm/lockfile.utils'
test('pkgSnapshotToResolution()', () => {
diff --git a/lockfile/verification/package.json b/lockfile/verification/package.json
index f6d9c6d3cf..bb630bcbc0 100644
--- a/lockfile/verification/package.json
+++ b/lockfile/verification/package.json
@@ -50,6 +50,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/constants": "workspace:*",
"@pnpm/lockfile.verification": "workspace:*",
"@pnpm/logger": "workspace:*",
diff --git a/lockfile/verification/test/allProjectsAreUpToDate.test.ts b/lockfile/verification/test/allProjectsAreUpToDate.test.ts
index 32b7d27a2a..4ded690e79 100644
--- a/lockfile/verification/test/allProjectsAreUpToDate.test.ts
+++ b/lockfile/verification/test/allProjectsAreUpToDate.test.ts
@@ -2,6 +2,7 @@ import { createWriteStream } from 'node:fs'
import { mkdir, writeFile } from 'node:fs/promises'
import { pipeline } from 'node:stream/promises'
+import { beforeEach, describe, expect, test } from '@jest/globals'
import { LOCKFILE_VERSION } from '@pnpm/constants'
import { getTarballIntegrity } from '@pnpm/crypto.hash'
import type { LockfileObject } from '@pnpm/lockfile.types'
diff --git a/lockfile/verification/test/diffFlatRecords.test.ts b/lockfile/verification/test/diffFlatRecords.test.ts
index 65155c9a94..f987b50ccf 100644
--- a/lockfile/verification/test/diffFlatRecords.test.ts
+++ b/lockfile/verification/test/diffFlatRecords.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { type Diff, diffFlatRecords } from '../src/diffFlatRecords.js'
test('diffFlatRecords', () => {
diff --git a/lockfile/verification/test/satisfiesPackageManifest.ts b/lockfile/verification/test/satisfiesPackageManifest.ts
index 87b87bae07..c891b4e2b2 100644
--- a/lockfile/verification/test/satisfiesPackageManifest.ts
+++ b/lockfile/verification/test/satisfiesPackageManifest.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { satisfiesPackageManifest } from '@pnpm/lockfile.verification'
const DEFAULT_PKG_FIELDS = {
diff --git a/modules-mounter/daemon/test/createFuseHandlers.test.ts b/modules-mounter/daemon/test/createFuseHandlers.test.ts
index 23a2fcb995..528e692583 100644
--- a/modules-mounter/daemon/test/createFuseHandlers.test.ts
+++ b/modules-mounter/daemon/test/createFuseHandlers.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeAll, describe, expect, it, jest } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
jest.unstable_mockModule('fuse-native', () => ({ default: { ENOENT: -2 } }))
diff --git a/modules-mounter/daemon/test/makeVirtualNodeModules.test.ts b/modules-mounter/daemon/test/makeVirtualNodeModules.test.ts
index e159fd14a7..394effa42a 100644
--- a/modules-mounter/daemon/test/makeVirtualNodeModules.test.ts
+++ b/modules-mounter/daemon/test/makeVirtualNodeModules.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readWantedLockfile } from '@pnpm/lockfile.fs'
import { makeVirtualNodeModules } from '../src/makeVirtualNodeModules.js'
diff --git a/network/auth-header/package.json b/network/auth-header/package.json
index a2c50a2876..acb40004b2 100644
--- a/network/auth-header/package.json
+++ b/network/auth-header/package.json
@@ -37,6 +37,7 @@
"@pnpm/types": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/network.auth-header": "workspace:*",
"safe-buffer": "catalog:"
},
diff --git a/network/auth-header/test/getAuthHeaderByURI.ts b/network/auth-header/test/getAuthHeaderByURI.ts
index b9b923ed7d..8f504b249a 100644
--- a/network/auth-header/test/getAuthHeaderByURI.ts
+++ b/network/auth-header/test/getAuthHeaderByURI.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { createGetAuthHeaderByURI } from '@pnpm/network.auth-header'
const configByUri = {
diff --git a/network/auth-header/test/getAuthHeadersFromConfig.test.ts b/network/auth-header/test/getAuthHeadersFromConfig.test.ts
index 816a7d392d..67c5a6b253 100644
--- a/network/auth-header/test/getAuthHeadersFromConfig.test.ts
+++ b/network/auth-header/test/getAuthHeadersFromConfig.test.ts
@@ -1,6 +1,8 @@
import os from 'node:os'
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
+
import { getAuthHeadersFromCreds } from '../src/getAuthHeadersFromConfig.js'
const osTokenHelper = {
diff --git a/network/auth-header/test/removePort.test.ts b/network/auth-header/test/removePort.test.ts
index 6c1e406ab8..24d6fdd472 100644
--- a/network/auth-header/test/removePort.test.ts
+++ b/network/auth-header/test/removePort.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, it } from '@jest/globals'
+
import { removePort } from '../src/helpers/removePort.js'
describe('removePort()', () => {
diff --git a/network/fetch/package.json b/network/fetch/package.json
index a35eaa71ac..2ce135d1d9 100644
--- a/network/fetch/package.json
+++ b/network/fetch/package.json
@@ -47,6 +47,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/network.fetch": "workspace:*",
"https-proxy-server-express": "catalog:"
diff --git a/network/fetch/test/dispatcher.test.ts b/network/fetch/test/dispatcher.test.ts
index da3da23a97..94985f8521 100644
--- a/network/fetch/test/dispatcher.test.ts
+++ b/network/fetch/test/dispatcher.test.ts
@@ -1,6 +1,7 @@
///
import net from 'node:net'
+import { afterEach, describe, expect, test } from '@jest/globals'
import { clearDispatcherCache, type DispatcherOptions, getDispatcher } from '@pnpm/network.fetch'
import { Agent, ProxyAgent } from 'undici'
diff --git a/network/fetch/test/fetchFromRegistry.test.ts b/network/fetch/test/fetchFromRegistry.test.ts
index fb6da7ebb4..67cda1b46c 100644
--- a/network/fetch/test/fetchFromRegistry.test.ts
+++ b/network/fetch/test/fetchFromRegistry.test.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { clearDispatcherCache, createFetchFromRegistry } from '@pnpm/network.fetch'
import { ProxyServer } from 'https-proxy-server-express'
import { type Dispatcher, getGlobalDispatcher, MockAgent, setGlobalDispatcher } from 'undici'
diff --git a/network/git-utils/package.json b/network/git-utils/package.json
index 1fb2f72a43..bf38ce871f 100644
--- a/network/git-utils/package.json
+++ b/network/git-utils/package.json
@@ -38,6 +38,7 @@
"execa": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/network.git-utils": "workspace:*",
"tempy": "catalog:"
},
diff --git a/network/git-utils/test/index.test.ts b/network/git-utils/test/index.test.ts
index f3bb2724f8..8bf6bc8211 100644
--- a/network/git-utils/test/index.test.ts
+++ b/network/git-utils/test/index.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getCurrentBranch, isGitRepo, isWorkingTreeClean } from '@pnpm/network.git-utils'
import { safeExeca as execa } from 'execa'
import { temporaryDirectory } from 'tempy'
diff --git a/network/web-auth/test/WebAuthTimeoutError.test.ts b/network/web-auth/test/WebAuthTimeoutError.test.ts
index 5654a39267..fdf99bd7e8 100644
--- a/network/web-auth/test/WebAuthTimeoutError.test.ts
+++ b/network/web-auth/test/WebAuthTimeoutError.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { WebAuthTimeoutError } from '@pnpm/network.web-auth'
describe('WebAuthTimeoutError', () => {
diff --git a/network/web-auth/test/generateQrCode.test.ts b/network/web-auth/test/generateQrCode.test.ts
index 2d50d64517..a4d046195b 100644
--- a/network/web-auth/test/generateQrCode.test.ts
+++ b/network/web-auth/test/generateQrCode.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { generateQrCode } from '@pnpm/network.web-auth'
describe('generateQrCode', () => {
diff --git a/network/web-auth/test/pollForWebAuthToken.test.ts b/network/web-auth/test/pollForWebAuthToken.test.ts
index 81da44e816..66c1c00712 100644
--- a/network/web-auth/test/pollForWebAuthToken.test.ts
+++ b/network/web-auth/test/pollForWebAuthToken.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import {
pollForWebAuthToken,
type WebAuthContext,
diff --git a/network/web-auth/test/promptBrowserOpen.test.ts b/network/web-auth/test/promptBrowserOpen.test.ts
index 97e574f3be..07db7030b1 100644
--- a/network/web-auth/test/promptBrowserOpen.test.ts
+++ b/network/web-auth/test/promptBrowserOpen.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, describe, expect, it, jest } from '@jest/globals'
import type {
PromptBrowserOpenContext,
PromptBrowserOpenReadlineInterface,
diff --git a/network/web-auth/test/withOtpHandling.test.ts b/network/web-auth/test/withOtpHandling.test.ts
index 257c9e3b7f..912eb45185 100644
--- a/network/web-auth/test/withOtpHandling.test.ts
+++ b/network/web-auth/test/withOtpHandling.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, it, jest } from '@jest/globals'
import {
type OtpContext,
OtpNonInteractiveError,
diff --git a/object/key-sorting/package.json b/object/key-sorting/package.json
index 9f1e105b82..259b547dab 100644
--- a/object/key-sorting/package.json
+++ b/object/key-sorting/package.json
@@ -36,6 +36,7 @@
"sort-keys": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/object.key-sorting": "workspace:*"
},
"engines": {
diff --git a/object/key-sorting/test/index.test.ts b/object/key-sorting/test/index.test.ts
index ad3d39f8c8..2c41b5f475 100644
--- a/object/key-sorting/test/index.test.ts
+++ b/object/key-sorting/test/index.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { sortKeysByPriority } from '@pnpm/object.key-sorting'
test('sortKeysByPriority', () => {
diff --git a/object/property-path/package.json b/object/property-path/package.json
index d7ac07fd0c..003dd14671 100644
--- a/object/property-path/package.json
+++ b/object/property-path/package.json
@@ -35,6 +35,7 @@
"@pnpm/error": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/object.property-path": "workspace:*"
},
"engines": {
diff --git a/object/property-path/test/get.test.ts b/object/property-path/test/get.test.ts
index c13446bddb..cec906b7e2 100644
--- a/object/property-path/test/get.test.ts
+++ b/object/property-path/test/get.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getObjectValueByPropertyPathString } from '../src/index.js'
const OBJECT = {
diff --git a/object/property-path/test/parse.test.ts b/object/property-path/test/parse.test.ts
index 6ad07da3a1..b0e2524f41 100644
--- a/object/property-path/test/parse.test.ts
+++ b/object/property-path/test/parse.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import {
type ExactToken,
parsePropertyPath,
diff --git a/object/property-path/test/token/Identifier.test.ts b/object/property-path/test/token/Identifier.test.ts
index 03459d4ea7..27bec725f8 100644
--- a/object/property-path/test/token/Identifier.test.ts
+++ b/object/property-path/test/token/Identifier.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { type Identifier, parseIdentifier } from '../../src/index.js'
test('not an identifier', () => {
diff --git a/object/property-path/test/token/NumericLiteral.test.ts b/object/property-path/test/token/NumericLiteral.test.ts
index c4403b809e..6e3c5ea30d 100644
--- a/object/property-path/test/token/NumericLiteral.test.ts
+++ b/object/property-path/test/token/NumericLiteral.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { type NumericLiteral, parseNumericLiteral } from '../../src/index.js'
test('not a numeric literal', () => {
diff --git a/object/property-path/test/token/StringLiteral.test.ts b/object/property-path/test/token/StringLiteral.test.ts
index f4f0132784..c5fa590320 100644
--- a/object/property-path/test/token/StringLiteral.test.ts
+++ b/object/property-path/test/token/StringLiteral.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { parseStringLiteral, type StringLiteral } from '../../src/index.js'
test('not a string literal', () => {
diff --git a/object/property-path/test/token/tokenize.test.ts b/object/property-path/test/token/tokenize.test.ts
index 5c0b0cde06..484508cfc8 100644
--- a/object/property-path/test/token/tokenize.test.ts
+++ b/object/property-path/test/token/tokenize.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { type Token, tokenize } from '../../src/index.js'
test('valid tokens', () => {
diff --git a/patching/apply-patch/test/applyPatchToDir.ts b/patching/apply-patch/test/applyPatchToDir.ts
index 2d57f8e7d2..78f6d9ee8f 100644
--- a/patching/apply-patch/test/applyPatchToDir.ts
+++ b/patching/apply-patch/test/applyPatchToDir.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, describe, expect, it, jest } from '@jest/globals'
import { tempDir } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
diff --git a/patching/commands/test/getEditDirPath.test.ts b/patching/commands/test/getEditDirPath.test.ts
index 32fcbee690..5a95fd59d6 100644
--- a/patching/commands/test/getEditDirPath.test.ts
+++ b/patching/commands/test/getEditDirPath.test.ts
@@ -1,5 +1,7 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
+
import { getEditDirPath } from '../src/getEditDirPath.js'
test('getEditDirPath() returns path to pkg@version inside node_modules/.pnpm_patches', () => {
diff --git a/patching/commands/test/patch.test.ts b/patching/commands/test/patch.test.ts
index 5737fbd9db..926e19a918 100644
--- a/patching/commands/test/patch.test.ts
+++ b/patching/commands/test/patch.test.ts
@@ -2,7 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeAll, beforeEach, describe, expect, it, jest, test } from '@jest/globals'
import { install } from '@pnpm/installing.commands'
import type { PatchCommandOptions, PatchRemoveCommandOptions } from '@pnpm/patching.commands'
import { prepare, preparePackages, tempDir } from '@pnpm/prepare'
@@ -659,7 +659,7 @@ describe('multiple versions', () => {
type: 'confirm',
name: 'applyToAll',
},
- ]]])
+ ]]] as unknown as Record[])
const patchDir = getPatchDirFromPatchOutput(output)
const fileToPatch = path.join(patchDir, 'index.js')
@@ -765,7 +765,7 @@ describe('prompt to choose version', () => {
type: 'confirm',
name: 'applyToAll',
},
- ]]])
+ ]]] as unknown as Record[])
const patchDir = getPatchDirFromPatchOutput(output)
@@ -832,7 +832,7 @@ describe('prompt to choose version', () => {
type: 'confirm',
name: 'applyToAll',
},
- ]]])
+ ]]] as unknown as Record[])
const patchDir = getPatchDirFromPatchOutput(output)
@@ -1226,7 +1226,7 @@ describe('patch and commit in workspaces', () => {
type: 'confirm',
name: 'applyToAll',
},
- ]]])
+ ]]] as unknown as Record[])
const patchDir = getPatchDirFromPatchOutput(output)
expect(fs.existsSync(patchDir)).toBe(true)
expect(fs.readFileSync(path.join(patchDir, 'index.js'), 'utf8')).toContain('module.exports = \'Hi\'')
diff --git a/patching/config/package.json b/patching/config/package.json
index c4a02a4951..28e62e47f6 100644
--- a/patching/config/package.json
+++ b/patching/config/package.json
@@ -41,6 +41,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/patching.config": "workspace:*",
"@types/semver": "catalog:"
},
diff --git a/patching/config/test/getPatchInfo.test.ts b/patching/config/test/getPatchInfo.test.ts
index 246fb28b0d..eecffc4ed1 100644
--- a/patching/config/test/getPatchInfo.test.ts
+++ b/patching/config/test/getPatchInfo.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getPatchInfo } from '../src/getPatchInfo.js'
import type { PatchGroupRecord } from '../src/index.js'
diff --git a/patching/config/test/groupPatchedDependencies.test.ts b/patching/config/test/groupPatchedDependencies.test.ts
index 88be3701fd..f9fac7759e 100644
--- a/patching/config/test/groupPatchedDependencies.test.ts
+++ b/patching/config/test/groupPatchedDependencies.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { ExtendedPatchInfo, PatchGroupRecord } from '@pnpm/patching.types'
import { groupPatchedDependencies } from '../src/groupPatchedDependencies.js'
diff --git a/patching/config/test/index.test.ts b/patching/config/test/index.test.ts
index b4980a4e2b..ca4ce19e96 100644
--- a/patching/config/test/index.test.ts
+++ b/patching/config/test/index.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { getPatchInfo, groupPatchedDependencies } from '../src/index.js'
const _getPatchInfo = (patchedDependencies: Record, name: string, version: string) =>
diff --git a/pkg-manifest/reader/package.json b/pkg-manifest/reader/package.json
index bde2a298b6..830ea88fef 100644
--- a/pkg-manifest/reader/package.json
+++ b/pkg-manifest/reader/package.json
@@ -38,6 +38,7 @@
"normalize-package-data": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/pkg-manifest.reader": "workspace:*",
"@types/normalize-package-data": "catalog:"
},
diff --git a/pkg-manifest/reader/test/index.ts b/pkg-manifest/reader/test/index.ts
index e77ec1f45e..09b6a87f4d 100644
--- a/pkg-manifest/reader/test/index.ts
+++ b/pkg-manifest/reader/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readPackageJson, readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader'
const fixtures = path.join(import.meta.dirname, 'fixtures')
diff --git a/pkg-manifest/utils/package.json b/pkg-manifest/utils/package.json
index 12e58a320f..7ea0ce4bd5 100644
--- a/pkg-manifest/utils/package.json
+++ b/pkg-manifest/utils/package.json
@@ -42,6 +42,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/pkg-manifest.utils": "workspace:*",
"@types/semver": "catalog:"
diff --git a/pkg-manifest/utils/test/convertEnginesRuntimeToDependencies.test.ts b/pkg-manifest/utils/test/convertEnginesRuntimeToDependencies.test.ts
index 3397f66480..ff704fdcf8 100644
--- a/pkg-manifest/utils/test/convertEnginesRuntimeToDependencies.test.ts
+++ b/pkg-manifest/utils/test/convertEnginesRuntimeToDependencies.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import {
applyRuntimeOnFailOverride,
convertEnginesRuntimeToDependencies,
diff --git a/pkg-manifest/utils/test/getAllUniqueSpecs.test.ts b/pkg-manifest/utils/test/getAllUniqueSpecs.test.ts
index e4735099c8..3ee23a849a 100644
--- a/pkg-manifest/utils/test/getAllUniqueSpecs.test.ts
+++ b/pkg-manifest/utils/test/getAllUniqueSpecs.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { getAllUniqueSpecs } from '@pnpm/pkg-manifest.utils'
test('getAllUniqueSpecs()', () => {
diff --git a/pkg-manifest/utils/test/getDependencyTypeFromManifest.test.ts b/pkg-manifest/utils/test/getDependencyTypeFromManifest.test.ts
index 8041a954b1..0aaffe7e2e 100644
--- a/pkg-manifest/utils/test/getDependencyTypeFromManifest.test.ts
+++ b/pkg-manifest/utils/test/getDependencyTypeFromManifest.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { getDependencyTypeFromManifest } from '@pnpm/pkg-manifest.utils'
test('getDependencyTypeFromManifest()', () => {
diff --git a/pkg-manifest/utils/test/getSpecFromPackageManifest.test.ts b/pkg-manifest/utils/test/getSpecFromPackageManifest.test.ts
index 9e3778229c..0164fcf48e 100644
--- a/pkg-manifest/utils/test/getSpecFromPackageManifest.test.ts
+++ b/pkg-manifest/utils/test/getSpecFromPackageManifest.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { getSpecFromPackageManifest } from '@pnpm/pkg-manifest.utils'
test('getSpecFromPackageManifest()', () => {
diff --git a/pkg-manifest/utils/test/updateProjectManifestObject.test.ts b/pkg-manifest/utils/test/updateProjectManifestObject.test.ts
index 0f078dec85..d14a6b3b79 100644
--- a/pkg-manifest/utils/test/updateProjectManifestObject.test.ts
+++ b/pkg-manifest/utils/test/updateProjectManifestObject.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { guessDependencyType, updateProjectManifestObject } from '@pnpm/pkg-manifest.utils'
test('guessDependencyType()', () => {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index a93883aa6b..9f0e68b587 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -422,8 +422,8 @@ catalogs:
specifier: ^8.57.1
version: 8.58.1
'@typescript/native-preview':
- specifier: 7.0.0-dev.20260216.1
- version: 7.0.0-dev.20260216.1
+ specifier: 7.0.0-dev.20260421.2
+ version: 7.0.0-dev.20260421.2
'@yarnpkg/core':
specifier: 4.5.0
version: 4.5.0
@@ -1048,7 +1048,7 @@ importers:
version: 4.0.3
'@typescript/native-preview':
specifier: 'catalog:'
- version: 7.0.0-dev.20260216.1
+ version: 7.0.0-dev.20260421.2
c8:
specifier: 'catalog:'
version: 11.0.0
@@ -1158,6 +1158,9 @@ importers:
__utils__/assert-project:
dependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/assert-store':
specifier: workspace:*
version: link:../assert-store
@@ -1210,6 +1213,9 @@ importers:
__utils__/assert-store:
dependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/registry-mock':
specifier: 'catalog:'
version: 6.0.0(encoding@0.1.13)(verdaccio@6.3.2(encoding@0.1.13)(typanion@3.14.0))
@@ -1226,6 +1232,9 @@ importers:
'@pnpm/constants':
specifier: workspace:*
version: link:../../core/constants
+ '@types/node':
+ specifier: 'catalog:'
+ version: 22.19.17
__utils__/eslint-config:
dependencies:
@@ -1415,6 +1424,9 @@ importers:
__utils__/test-ipc-server:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/prepare':
specifier: workspace:*
version: link:../prepare
@@ -1682,6 +1694,9 @@ importers:
specifier: 'catalog:'
version: 0.2.16
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/bins.resolver':
specifier: workspace:*
version: 'link:'
@@ -1973,6 +1988,9 @@ importers:
specifier: 'catalog:'
version: 5.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/building.during-install':
specifier: workspace:*
version: 'link:'
@@ -2002,6 +2020,9 @@ importers:
specifier: workspace:*
version: link:../../core/types
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/building.policy':
specifier: workspace:*
version: 'link:'
@@ -2064,6 +2085,9 @@ importers:
specifier: 'catalog:'
version: 2.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/cache.commands':
specifier: workspace:*
version: 'link:'
@@ -2092,6 +2116,9 @@ importers:
specifier: workspace:*
version: link:../../core/error
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/catalogs.config':
specifier: workspace:*
version: 'link:'
@@ -2104,6 +2131,9 @@ importers:
catalogs/protocol-parser:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/catalogs.protocol-parser':
specifier: workspace:*
version: 'link:'
@@ -2267,6 +2297,9 @@ importers:
specifier: 'catalog:'
version: 7.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/cli.default-reporter':
specifier: workspace:*
version: 'link:'
@@ -2301,6 +2334,9 @@ importers:
specifier: 'catalog:'
version: 7.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/cli.meta':
specifier: workspace:*
version: 'link:'
@@ -2320,6 +2356,9 @@ importers:
specifier: 'catalog:'
version: 7.0.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/cli.parse-cli-args':
specifier: workspace:*
version: 'link:'
@@ -2437,6 +2476,9 @@ importers:
specifier: 'catalog:'
version: 5.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/config.matcher':
specifier: workspace:*
version: 'link:'
@@ -2518,6 +2560,9 @@ importers:
specifier: workspace:*
version: link:../../resolving/parse-wanted-dependency
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/config.parse-overrides':
specifier: workspace:*
version: 'link:'
@@ -2528,6 +2573,9 @@ importers:
specifier: workspace:*
version: link:../../core/types
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/config.pick-registry-for-package':
specifier: workspace:*
version: 'link:'
@@ -2668,6 +2716,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/config.version-policy':
specifier: workspace:*
version: 'link:'
@@ -2713,6 +2764,9 @@ importers:
specifier: workspace:*
version: link:../constants
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/error':
specifier: workspace:*
version: 'link:'
@@ -2726,6 +2780,9 @@ importers:
specifier: 'catalog:'
version: 4.2.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/logger':
specifier: workspace:*
version: 'link:'
@@ -2745,6 +2802,9 @@ importers:
specifier: 'catalog:'
version: 13.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/crypto.hash':
specifier: workspace:*
version: 'link:'
@@ -2767,6 +2827,9 @@ importers:
specifier: workspace:*
version: link:../../core/error
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/crypto.integrity':
specifier: workspace:*
version: 'link:'
@@ -2780,6 +2843,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/crypto.object-hasher':
specifier: workspace:*
version: 'link:'
@@ -2802,6 +2868,9 @@ importers:
specifier: workspace:*
version: link:../../fetching/types
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/crypto.shasums-file':
specifier: workspace:*
version: 'link:'
@@ -2842,6 +2911,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/constants':
specifier: workspace:*
version: link:../../../core/constants
@@ -3002,6 +3074,9 @@ importers:
deps/compliance/license-resolver:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.compliance.license-resolver':
specifier: workspace:*
version: 'link:'
@@ -3222,12 +3297,18 @@ importers:
specifier: 'catalog:'
version: 2.1.2
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.graph-hasher':
specifier: workspace:*
version: 'link:'
deps/graph-sequencer:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.graph-sequencer':
specifier: workspace:*
version: 'link:'
@@ -3401,6 +3482,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.inspection.list':
specifier: workspace:*
version: 'link:'
@@ -3517,6 +3601,9 @@ importers:
specifier: 'catalog:'
version: 0.3.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.inspection.peers-checker':
specifier: workspace:*
version: 'link:'
@@ -3587,6 +3674,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/constants':
specifier: workspace:*
version: link:../../../core/constants
@@ -3615,6 +3705,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/deps.path':
specifier: workspace:*
version: 'link:'
@@ -3964,6 +4057,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/engine.runtime.node-resolver':
specifier: workspace:*
version: 'link:'
@@ -4195,6 +4291,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/exec.lifecycle':
specifier: workspace:*
version: 'link:'
@@ -4257,6 +4356,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/exec.prepare-package':
specifier: workspace:*
version: 'link:'
@@ -4608,6 +4710,9 @@ importers:
specifier: 'catalog:'
version: 7.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/fs.hard-link-dir':
specifier: workspace:*
version: 'link:'
@@ -4672,6 +4777,9 @@ importers:
fs/is-empty-dir-or-nothing:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/fs.is-empty-dir-or-nothing':
specifier: workspace:*
version: 'link:'
@@ -4711,6 +4819,9 @@ importers:
specifier: 'catalog:'
version: 10.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/fs.symlink-dependency':
specifier: workspace:*
version: 'link:'
@@ -4772,6 +4883,9 @@ importers:
specifier: 'catalog:'
version: 10.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/global.commands':
specifier: workspace:*
version: 'link:'
@@ -4828,6 +4942,9 @@ importers:
specifier: 'catalog:'
version: 2.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/fetching.fetcher-base':
specifier: workspace:*
version: link:../../fetching/fetcher-base
@@ -4963,6 +5080,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/fetching.fetcher-base':
specifier: workspace:*
version: link:../../fetching/fetcher-base
@@ -5277,6 +5397,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.context':
specifier: workspace:*
version: 'link:'
@@ -5302,6 +5425,9 @@ importers:
specifier: workspace:*
version: link:../../../core/types
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.dedupe.check':
specifier: workspace:*
version: 'link:'
@@ -5318,6 +5444,9 @@ importers:
specifier: 'catalog:'
version: 5.6.2
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.dedupe.issues-renderer':
specifier: workspace:*
version: 'link:'
@@ -5752,6 +5881,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.deps-resolver':
specifier: workspace:*
version: 'link:'
@@ -6015,6 +6147,9 @@ importers:
specifier: 'catalog:'
version: 10.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.env-installer':
specifier: workspace:*
version: 'link:'
@@ -6169,6 +6304,9 @@ importers:
specifier: 'catalog:'
version: 4.0.7(typanion@3.14.0)
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.linking.real-hoist':
specifier: workspace:*
version: 'link:'
@@ -6200,6 +6338,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.modules-yaml':
specifier: workspace:*
version: 'link:'
@@ -6557,6 +6698,9 @@ importers:
specifier: 'catalog:'
version: 7.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/lockfile.make-dedicated-lockfile':
specifier: workspace:*
version: 'link:'
@@ -6588,6 +6732,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/lockfile.merger':
specifier: workspace:*
version: 'link:'
@@ -6638,6 +6785,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/lockfile.pruner':
specifier: workspace:*
version: 'link:'
@@ -6706,6 +6856,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/lockfile.to-pnp':
specifier: workspace:*
version: 'link:'
@@ -6765,6 +6918,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/lockfile.utils':
specifier: workspace:*
version: 'link:'
@@ -6823,6 +6979,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/constants':
specifier: workspace:*
version: link:../../core/constants
@@ -6935,6 +7094,9 @@ importers:
specifier: workspace:*
version: link:../../core/types
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/network.auth-header':
specifier: workspace:*
version: 'link:'
@@ -6972,6 +7134,9 @@ importers:
specifier: 'catalog:'
version: 7.24.8
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/logger':
specifier: workspace:*
version: link:../../core/logger
@@ -6988,6 +7153,9 @@ importers:
specifier: 'catalog:'
version: safe-execa@0.3.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/network.git-utils':
specifier: workspace:*
version: 'link:'
@@ -7026,6 +7194,9 @@ importers:
specifier: 'catalog:'
version: 6.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/object.key-sorting':
specifier: workspace:*
version: 'link:'
@@ -7036,6 +7207,9 @@ importers:
specifier: workspace:*
version: link:../../core/error
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/object.property-path':
specifier: workspace:*
version: 'link:'
@@ -7228,6 +7402,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/patching.config':
specifier: workspace:*
version: 'link:'
@@ -7256,6 +7433,9 @@ importers:
specifier: 'catalog:'
version: 8.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/pkg-manifest.reader':
specifier: workspace:*
version: 'link:'
@@ -7281,6 +7461,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/logger':
specifier: workspace:*
version: link:../../core/logger
@@ -8062,6 +8245,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/catalogs.config':
specifier: workspace:*
version: link:../../catalogs/config
@@ -8194,6 +8380,9 @@ importers:
specifier: workspace:*
version: link:../../core/error
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/resolving.jsr-specifier-parser':
specifier: workspace:*
version: 'link:'
@@ -8328,6 +8517,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/config.version-policy':
specifier: workspace:*
version: link:../../config/version-policy
@@ -8387,6 +8579,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/logger':
specifier: workspace:*
version: link:../../../core/logger
@@ -8426,6 +8621,9 @@ importers:
specifier: workspace:*
version: link:../resolver-base
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/network.fetch':
specifier: workspace:*
version: link:../../network/fetch
@@ -8439,6 +8637,9 @@ importers:
specifier: 'catalog:'
version: 1.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/shell.path':
specifier: workspace:*
version: 'link:'
@@ -8482,6 +8683,9 @@ importers:
specifier: 'catalog:'
version: 5.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/store.cafs':
specifier: workspace:*
version: 'link:'
@@ -8746,6 +8950,9 @@ importers:
specifier: 'catalog:'
version: 10.0.1
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/installing.client':
specifier: workspace:*
version: link:../../installing/client
@@ -8836,6 +9043,9 @@ importers:
specifier: 'catalog:'
version: 1.11.8
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/store.index':
specifier: workspace:*
version: 'link:'
@@ -8913,6 +9123,9 @@ importers:
specifier: workspace:*
version: link:../index
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/store.pkg-finder':
specifier: workspace:*
version: 'link:'
@@ -8968,18 +9181,27 @@ importers:
specifier: 'catalog:'
version: 1.2.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/text.comments-parser':
specifier: workspace:*
version: 'link:'
text/naming-cases:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/text.naming-cases':
specifier: workspace:*
version: 'link:'
text/tree-renderer:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/text.tree-renderer':
specifier: workspace:*
version: 'link:'
@@ -9029,6 +9251,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/logger':
specifier: workspace:*
version: link:../core/logger
@@ -9078,6 +9303,9 @@ importers:
specifier: 'catalog:'
version: 2.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/prepare':
specifier: workspace:*
version: link:../../__utils__/prepare
@@ -9185,6 +9413,9 @@ importers:
specifier: 'catalog:'
version: 5.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/test-fixtures':
specifier: workspace:*
version: link:../../__utils__/test-fixtures
@@ -9219,6 +9450,9 @@ importers:
specifier: 'catalog:'
version: 6.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.project-manifest-writer':
specifier: workspace:*
version: 'link:'
@@ -9262,6 +9496,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/types':
specifier: workspace:*
version: link:../../core/types
@@ -9311,6 +9548,9 @@ importers:
specifier: 'catalog:'
version: '@pnpm/ramda@0.28.1'
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.projects-graph':
specifier: workspace:*
version: 'link:'
@@ -9377,6 +9617,9 @@ importers:
specifier: 'catalog:'
version: 7.7.4
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.range-resolver':
specifier: workspace:*
version: 'link:'
@@ -9393,12 +9636,18 @@ importers:
specifier: 'catalog:'
version: 8.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.root-finder':
specifier: workspace:*
version: 'link:'
workspace/spec-parser:
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.spec-parser':
specifier: workspace:*
version: 'link:'
@@ -9449,6 +9698,9 @@ importers:
specifier: 'catalog:'
version: 3.0.0
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/workspace.workspace-manifest-reader':
specifier: workspace:*
version: 'link:'
@@ -9489,6 +9741,9 @@ importers:
specifier: 'catalog:'
version: 2.8.3
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/prepare':
specifier: workspace:*
version: link:../../__utils__/prepare
@@ -9520,6 +9775,9 @@ importers:
specifier: 'catalog:'
version: 2.8.3
devDependencies:
+ '@jest/globals':
+ specifier: 'catalog:'
+ version: 30.3.0
'@pnpm/yaml.document-sync':
specifier: workspace:*
version: 'link:'
@@ -11580,43 +11838,43 @@ packages:
resolution: {integrity: sha512-y+vH7QE8ycjoa0bWciFg7OpFcipUuem1ujhrdLtq1gByKwfbC7bPeKsiny9e0urg93DqwGcHey+bGRKCnF1nZQ==}
engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0}
- '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-ZcxlhZ4Scm1LFKeGXo7V+B4H1Mb27/uVBO1o7d060jRIpGRuCOxsELo7jgUY8UhhTXtSpLECHsmAj8EyERSi9w==}
+ '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-fHv1r3ZmVo6zxuAIFmuX3w9QxbcauoG0SsWhmDwm6VmRubLlOJIcmTtlmV3JAb9oOnq8LuzZljzT7Q39fSMQDw==}
cpu: [arm64]
os: [darwin]
- '@typescript/native-preview-darwin-x64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-hY+hondi5/2m0rNSIgRkOfmA6FIx+KKnjPd9R6hHHumQu00XXoYA/xcIq3SyV1sXtowkhN+hR3ZUp1y3Orb84A==}
+ '@typescript/native-preview-darwin-x64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-KWTR6xbW9t+JS7D5DQIzo75pqVXVWUxF9PMv/+S6xsnOjCVd6g0ixHcFpFMJMKSUQpGPr8Z5f7b8ks6LHW01jg==}
cpu: [x64]
os: [darwin]
- '@typescript/native-preview-linux-arm64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-L+3CgBVAjpYnWgulmTWOTp7IdbLjgOzLpppr2597i79KE5MV7UyC73UCdvK3GtAl1Huiss0HsWVBBEYRkLQsfw==}
+ '@typescript/native-preview-linux-arm64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-VLMEuml3BhUb+jaL0TXQ4xvVODxJF+RhkI+tBWvlynsJI4khTXEiwWh+wPOJrsfBRYFRMXEu28Odl/HXkYze8w==}
cpu: [arm64]
os: [linux]
- '@typescript/native-preview-linux-arm@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-Q+HBF1rlwpV1Nh2AESwte0lEHNPYVvbRLPQzTrorvx3gvXdRzfO9tHa6JL8Y1BO2KmSZBKmT7U+0188icTPBSg==}
+ '@typescript/native-preview-linux-arm@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-BWLQO3nemLDSV5PoE5GPHe1dU9Dth77Kv8/cle9Ujcp4LhPo0KincdPqFH/qKeU/xvW25mgFueflZ1nc4rKuww==}
cpu: [arm]
os: [linux]
- '@typescript/native-preview-linux-x64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-qIaQFRL2s+fi3zbS0+fCgR1Nk7fXMnbLW7wsFpcwn3fpEYuMdiQY9pwE8SvJsw2M78xZlXL5L9l5CL8ti0cNZQ==}
+ '@typescript/native-preview-linux-x64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-qUrJWTB5/wv4wnRG0TRXElAxc2kykNiRNyEIEqBbLmzDlrcvAW7RRy8MXoY1ZyTiKGMu14itZ3x9oW6+blFpRw==}
cpu: [x64]
os: [linux]
- '@typescript/native-preview-win32-arm64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-Yu7OLyMng9A2GA0vlZ8WZuqAnI+WM55UaY1UwA03TJdcljk/AcEzb/99fEq5g0kPg3k2wwHiyMrCGxxu99+gXQ==}
+ '@typescript/native-preview-win32-arm64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-Rc6NsWlZmCs5YUKVzKgwoBOoRUGsPzct4BDMRX0csD1devLBBc4AbUXWKsJRbpwIAnqMO1ld4sNHEb+wXgfNHQ==}
cpu: [arm64]
os: [win32]
- '@typescript/native-preview-win32-x64@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-Lc+E1UNGKioOtKHUm1CLFO3W2PFWdLpJ6j2uB52RH0zhb63p4CEGCsuDH36QvgsXLibviExeNUF5Dum0rNKT9g==}
+ '@typescript/native-preview-win32-x64@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-GQv1+dya1t6EqF2Cpsb+xoozovdX10JUSf6Kl/8xNkTapzmlHd+uMr+8ku3jIASTxoRGn0Mklgjj3MDKrOTuLg==}
cpu: [x64]
os: [win32]
- '@typescript/native-preview@7.0.0-dev.20260216.1':
- resolution: {integrity: sha512-Vhffqcro1Q3w1zRgZ0E1C5JOB+8CtwKjSsszYfpGkt0qvRtOBO227AcnQe1sEiX+VLZW3Iw1VGVMhc8hNhpRZw==}
+ '@typescript/native-preview@7.0.0-dev.20260421.2':
+ resolution: {integrity: sha512-CmajHI25HpVWE9R1XFoxr+cphJPxoYD3eFioQtAvXYkMFKnLdICMS9pXre9Pybizb75ejRxjKD5/CVG055rEIg==}
hasBin: true
'@ungap/structured-clone@1.3.0':
@@ -17835,7 +18093,7 @@ snapshots:
'@jest/console@30.3.0':
dependencies:
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
jest-message-util: 30.3.0
jest-util: 30.3.0
@@ -17849,14 +18107,14 @@ snapshots:
'@jest/test-result': 30.3.0
'@jest/transform': 30.3.0(@babel/types@7.29.0)
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 4.4.0
exit-x: 0.2.2
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
jest-changed-files: 30.3.0
- jest-config: 30.3.0(@babel/types@7.29.0)(@types/node@22.19.17)
+ jest-config: 30.3.0(@babel/types@7.29.0)(@types/node@25.6.0)
jest-haste-map: 30.3.0
jest-message-util: 30.3.0
jest-regex-util: 30.0.1
@@ -17919,7 +18177,7 @@ snapshots:
'@jest/pattern@30.0.1':
dependencies:
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
jest-regex-util: 30.0.1
'@jest/reporters@30.3.0(@babel/types@7.29.0)':
@@ -17930,7 +18188,7 @@ snapshots:
'@jest/transform': 30.3.0(@babel/types@7.29.0)
'@jest/types': 30.3.0
'@jridgewell/trace-mapping': 0.3.31
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
collect-v8-coverage: 1.0.3
exit-x: 0.2.2
@@ -18021,7 +18279,7 @@ snapshots:
'@jest/schemas': 30.0.5
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
'@types/yargs': 17.0.35
chalk: 4.1.2
@@ -19582,7 +19840,7 @@ snapshots:
'@types/responselike@1.0.0':
dependencies:
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
'@types/responselike@1.0.3':
dependencies:
@@ -19612,7 +19870,7 @@ snapshots:
'@types/touch@3.1.5':
dependencies:
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
'@types/treeify@1.0.3': {}
@@ -19725,36 +19983,36 @@ snapshots:
'@typescript-eslint/types': 8.58.1
eslint-visitor-keys: 5.0.1
- '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-darwin-arm64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-darwin-x64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-darwin-x64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-linux-arm64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-linux-arm64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-linux-arm@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-linux-arm@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-linux-x64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-linux-x64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-win32-arm64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-win32-arm64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview-win32-x64@7.0.0-dev.20260216.1':
+ '@typescript/native-preview-win32-x64@7.0.0-dev.20260421.2':
optional: true
- '@typescript/native-preview@7.0.0-dev.20260216.1':
+ '@typescript/native-preview@7.0.0-dev.20260421.2':
optionalDependencies:
- '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260216.1
- '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260216.1
- '@typescript/native-preview-linux-arm': 7.0.0-dev.20260216.1
- '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260216.1
- '@typescript/native-preview-linux-x64': 7.0.0-dev.20260216.1
- '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260216.1
- '@typescript/native-preview-win32-x64': 7.0.0-dev.20260216.1
+ '@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-darwin-x64': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-linux-arm': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-linux-arm64': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-linux-x64': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-win32-arm64': 7.0.0-dev.20260421.2
+ '@typescript/native-preview-win32-x64': 7.0.0-dev.20260421.2
'@ungap/structured-clone@1.3.0': {}
@@ -22609,7 +22867,7 @@ snapshots:
'@jest/expect': 30.3.0
'@jest/test-result': 30.3.0
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
co: 4.6.0
dedent: 1.7.2
@@ -22682,6 +22940,38 @@ snapshots:
- babel-plugin-macros
- supports-color
+ jest-config@30.3.0(@babel/types@7.29.0)(@types/node@25.6.0):
+ dependencies:
+ '@babel/core': 7.29.0
+ '@jest/get-type': 30.1.0
+ '@jest/pattern': 30.0.1
+ '@jest/test-sequencer': 30.3.0
+ '@jest/types': 30.3.0
+ babel-jest: 30.3.0(@babel/core@7.29.0)(@babel/types@7.29.0)
+ chalk: 4.1.2
+ ci-info: 4.4.0
+ deepmerge: 4.3.1
+ glob: 11.1.0
+ graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
+ jest-circus: 30.3.0(@babel/types@7.29.0)
+ jest-docblock: 30.2.0
+ jest-environment-node: 30.3.0
+ jest-regex-util: 30.0.1
+ jest-resolve: 30.3.0
+ jest-runner: 30.3.0(@babel/types@7.29.0)
+ jest-util: 30.3.0
+ jest-validate: 30.3.0
+ parse-json: 5.2.0
+ pretty-format: 30.3.0
+ slash: 3.0.0
+ strip-json-comments: 3.1.1
+ optionalDependencies:
+ '@types/node': 25.6.0
+ transitivePeerDependencies:
+ - '@babel/types'
+ - babel-plugin-macros
+ - supports-color
+
jest-diff@30.3.0:
dependencies:
'@jest/diff-sequences': 30.3.0
@@ -22706,7 +22996,7 @@ snapshots:
'@jest/environment': 30.3.0
'@jest/fake-timers': 30.3.0
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
jest-mock: 30.3.0
jest-util: 30.3.0
jest-validate: 30.3.0
@@ -22732,7 +23022,7 @@ snapshots:
jest-haste-map@30.3.0:
dependencies:
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
@@ -22823,7 +23113,7 @@ snapshots:
'@jest/test-result': 30.3.0
'@jest/transform': 30.3.0(@babel/types@7.29.0)
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
emittery: 0.13.1
exit-x: 0.2.2
@@ -22853,7 +23143,7 @@ snapshots:
'@jest/test-result': 30.3.0
'@jest/transform': 30.3.0(@babel/types@7.29.0)
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
cjs-module-lexer: 2.2.0
collect-v8-coverage: 1.0.3
@@ -22910,7 +23200,7 @@ snapshots:
jest-util@30.3.0:
dependencies:
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
chalk: 4.1.2
ci-info: 4.4.0
graceful-fs: 4.2.11(patch_hash=68ebc232025360cb3dcd3081f4067f4e9fc022ab6b6f71a3230e86c7a5b337d1)
@@ -22938,7 +23228,7 @@ snapshots:
dependencies:
'@jest/test-result': 30.3.0
'@jest/types': 30.3.0
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
ansi-escapes: 4.3.2
chalk: 4.1.2
emittery: 0.13.1
@@ -22954,7 +23244,7 @@ snapshots:
jest-worker@30.3.0:
dependencies:
- '@types/node': 22.19.17
+ '@types/node': 25.6.0
'@ungap/structured-clone': 1.3.0
jest-util: 30.3.0
merge-stream: 2.0.0
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index dd8c45a065..c1651335bc 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -137,9 +137,7 @@ catalog:
'@types/yarnpkg__lockfile': ^1.1.9
'@types/zkochan__table': npm:@types/table@6.0.0
'@typescript-eslint/utils': ^8.57.1
- # Newer tsgo dev builds have a regression where @types/node can't be resolved,
- # causing all node built-in types (path, url, stream, process, etc.) to fail.
- '@typescript/native-preview': 7.0.0-dev.20260216.1
+ '@typescript/native-preview': 7.0.0-dev.20260421.2
'@yarnpkg/core': 4.5.0
'@yarnpkg/extensions': 2.0.6
'@yarnpkg/lockfile': ^1.1.0
diff --git a/pnpm/artifacts/exe/test/setup.test.ts b/pnpm/artifacts/exe/test/setup.test.ts
index 483e0ade45..16ff0fb28c 100644
--- a/pnpm/artifacts/exe/test/setup.test.ts
+++ b/pnpm/artifacts/exe/test/setup.test.ts
@@ -2,6 +2,7 @@ import { execFileSync } from 'node:child_process'
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { familySync } from 'detect-libc'
// @ts-expect-error — JS helper without type declarations
diff --git a/pnpm/src/checkForUpdates.test.ts b/pnpm/src/checkForUpdates.test.ts
index 30cb125983..627da5d335 100644
--- a/pnpm/src/checkForUpdates.test.ts
+++ b/pnpm/src/checkForUpdates.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import { prepareEmpty } from '@pnpm/prepare'
import { loadJsonFileSync } from 'load-json-file'
diff --git a/pnpm/src/shouldPersistLockfile.test.ts b/pnpm/src/shouldPersistLockfile.test.ts
index 63d4ba2140..e4659686b2 100644
--- a/pnpm/src/shouldPersistLockfile.test.ts
+++ b/pnpm/src/shouldPersistLockfile.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import { shouldPersistLockfile } from './shouldPersistLockfile.js'
describe('shouldPersistLockfile', () => {
diff --git a/pnpm/test/bin.ts b/pnpm/test/bin.ts
index 9a7d41b54a..246809b536 100644
--- a/pnpm/test/bin.ts
+++ b/pnpm/test/bin.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { tempDir } from '@pnpm/prepare'
import PATH_NAME from 'path-name'
diff --git a/pnpm/test/ci.ts b/pnpm/test/ci.ts
index a3bfe7bf53..27f3475ba0 100644
--- a/pnpm/test/ci.ts
+++ b/pnpm/test/ci.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, tempDir } from '@pnpm/prepare'
import { execPnpmSync } from './utils/index.js'
diff --git a/pnpm/test/clean.ts b/pnpm/test/clean.ts
index 26d6730455..cc65d8eb89 100644
--- a/pnpm/test/clean.ts
+++ b/pnpm/test/clean.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackages, tempDir } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/cli.ts b/pnpm/test/cli.ts
index 1e78a89356..3c01d55b69 100644
--- a/pnpm/test/cli.ts
+++ b/pnpm/test/cli.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { rimrafSync } from '@zkochan/rimraf'
diff --git a/pnpm/test/config.ts b/pnpm/test/config.ts
index e93960fb5a..5d5c4ba027 100644
--- a/pnpm/test/config.ts
+++ b/pnpm/test/config.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { prepare } from '@pnpm/prepare'
diff --git a/pnpm/test/config/get.ts b/pnpm/test/config/get.ts
index ea39c29a3d..227549f093 100644
--- a/pnpm/test/config/get.ts
+++ b/pnpm/test/config/get.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { WorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/config/list.ts b/pnpm/test/config/list.ts
index 5fa545054d..59848a51d0 100644
--- a/pnpm/test/config/list.ts
+++ b/pnpm/test/config/list.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { Config } from '@pnpm/config.reader'
import { prepare } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/configurationalDependencies.test.ts b/pnpm/test/configurationalDependencies.test.ts
index 8e132b296b..18d00ea1b1 100644
--- a/pnpm/test/configurationalDependencies.test.ts
+++ b/pnpm/test/configurationalDependencies.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readEnvLockfile } from '@pnpm/lockfile.fs'
import { prepare } from '@pnpm/prepare'
import { getIntegrity } from '@pnpm/registry-mock'
diff --git a/pnpm/test/deploy.ts b/pnpm/test/deploy.ts
index dfe05d11bc..dcf728900a 100644
--- a/pnpm/test/deploy.ts
+++ b/pnpm/test/deploy.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { loadJsonFileSync } from 'load-json-file'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/dlx.ts b/pnpm/test/dlx.ts
index b53c8f273b..9a27ce227a 100644
--- a/pnpm/test/dlx.ts
+++ b/pnpm/test/dlx.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { beforeAll, describe, expect, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import { dlx } from '@pnpm/exec.commands'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
diff --git a/pnpm/test/errorHandler.test.ts b/pnpm/test/errorHandler.test.ts
index b876e01b58..587cdfb0f1 100644
--- a/pnpm/test/errorHandler.test.ts
+++ b/pnpm/test/errorHandler.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare, preparePackages } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import getPort from 'get-port'
diff --git a/pnpm/test/exec.ts b/pnpm/test/exec.ts
index fcc7de0a34..eb4cc883b1 100644
--- a/pnpm/test/exec.ts
+++ b/pnpm/test/exec.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { execPnpm, execPnpmSync } from './utils/index.js'
diff --git a/pnpm/test/filterProd.test.ts b/pnpm/test/filterProd.test.ts
index cddce973a1..b1509b0902 100644
--- a/pnpm/test/filterProd.test.ts
+++ b/pnpm/test/filterProd.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import {
preparePackages,
} from '@pnpm/prepare'
diff --git a/pnpm/test/formatError.test.ts b/pnpm/test/formatError.test.ts
index 65ef5a3970..105990da3a 100644
--- a/pnpm/test/formatError.test.ts
+++ b/pnpm/test/formatError.test.ts
@@ -1,5 +1,7 @@
import { stripVTControlCharacters as stripAnsi } from 'node:util'
+import { expect, test } from '@jest/globals'
+
import { formatUnknownOptionsError } from '../src/formatError.js'
test('formatUnknownOptionsError()', async () => {
diff --git a/pnpm/test/getConfig.test.ts b/pnpm/test/getConfig.test.ts
index e529f8c1a8..cf36f2a586 100644
--- a/pnpm/test/getConfig.test.ts
+++ b/pnpm/test/getConfig.test.ts
@@ -1,8 +1,8 @@
-///
+///
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, describe, expect, jest, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { calcPnpmfilePathsOfPluginDeps, getConfig } from '../src/getConfig.js'
diff --git a/pnpm/test/help.spec.ts b/pnpm/test/help.spec.ts
index 2e119ed1f8..141804269d 100644
--- a/pnpm/test/help.spec.ts
+++ b/pnpm/test/help.spec.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { createHelp } from '../src/cmd/help.js'
test('print an error when help not found', () => {
diff --git a/pnpm/test/hooks.ts b/pnpm/test/hooks.ts
index e488597f49..1f48bf1839 100644
--- a/pnpm/test/hooks.ts
+++ b/pnpm/test/hooks.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { createHash } from '@pnpm/crypto.hash'
import { prepare, preparePackages } from '@pnpm/prepare'
import { getIntegrity } from '@pnpm/registry-mock'
diff --git a/pnpm/test/install/configDeps.ts b/pnpm/test/install/configDeps.ts
index 9dafe9f655..5c8aad15fe 100644
--- a/pnpm/test/install/configDeps.ts
+++ b/pnpm/test/install/configDeps.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { readEnvLockfile } from '@pnpm/lockfile.fs'
import { prepare } from '@pnpm/prepare'
import { getIntegrity } from '@pnpm/registry-mock'
diff --git a/pnpm/test/install/global.ts b/pnpm/test/install/global.ts
index e25ca52f9b..b7a5b1c45d 100644
--- a/pnpm/test/install/global.ts
+++ b/pnpm/test/install/global.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { GLOBAL_LAYOUT_VERSION } from '@pnpm/constants'
import { prepare } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
diff --git a/pnpm/test/install/globalVirtualStore.ts b/pnpm/test/install/globalVirtualStore.ts
index 6a561838cc..f6fa2e5dc0 100644
--- a/pnpm/test/install/globalVirtualStore.ts
+++ b/pnpm/test/install/globalVirtualStore.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { readYamlFileSync } from 'read-yaml-file'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/install/hoist.ts b/pnpm/test/install/hoist.ts
index 4a598ea992..408de6dfa7 100644
--- a/pnpm/test/install/hoist.ts
+++ b/pnpm/test/install/hoist.ts
@@ -1,3 +1,4 @@
+import { test } from '@jest/globals'
import { prepare, preparePackages } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/install/hooks.ts b/pnpm/test/install/hooks.ts
index e6fa372186..9a4a09b37f 100644
--- a/pnpm/test/install/hooks.ts
+++ b/pnpm/test/install/hooks.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { LockfileFile } from '@pnpm/lockfile.types'
import { prepare, preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/pnpm/test/install/issue-8959.ts b/pnpm/test/install/issue-8959.ts
index 0f51843856..29d9fe96ae 100644
--- a/pnpm/test/install/issue-8959.ts
+++ b/pnpm/test/install/issue-8959.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/install/lifecycleScripts.ts b/pnpm/test/install/lifecycleScripts.ts
index f1a71ea110..9ad34c897b 100644
--- a/pnpm/test/install/lifecycleScripts.ts
+++ b/pnpm/test/install/lifecycleScripts.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { PackageManifest, ProjectManifest } from '@pnpm/types'
import { readWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
diff --git a/pnpm/test/install/misc.ts b/pnpm/test/install/misc.ts
index 7365690d74..712ff5fee4 100644
--- a/pnpm/test/install/misc.ts
+++ b/pnpm/test/install/misc.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterAll, expect, test } from '@jest/globals'
import { STORE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import type { LockfileObject } from '@pnpm/lockfile.types'
import { readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader'
diff --git a/pnpm/test/install/nodeRuntime.ts b/pnpm/test/install/nodeRuntime.ts
index 954bb4e3ff..834a7fe915 100644
--- a/pnpm/test/install/nodeRuntime.ts
+++ b/pnpm/test/install/nodeRuntime.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { execPnpm } from '../utils/index.js'
diff --git a/pnpm/test/install/only.ts b/pnpm/test/install/only.ts
index 05cc7e5014..eca2f92eb9 100644
--- a/pnpm/test/install/only.ts
+++ b/pnpm/test/install/only.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { PackageManifest } from '@pnpm/types'
import { loadJsonFileSync } from 'load-json-file'
diff --git a/pnpm/test/install/optional.ts b/pnpm/test/install/optional.ts
index 73f2811be8..80565a4f43 100644
--- a/pnpm/test/install/optional.ts
+++ b/pnpm/test/install/optional.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import deepRequireCwd from 'deep-require-cwd'
diff --git a/pnpm/test/install/pnpmRegistry.ts b/pnpm/test/install/pnpmRegistry.ts
index fe9482d4e6..a69ea245d3 100644
--- a/pnpm/test/install/pnpmRegistry.ts
+++ b/pnpm/test/install/pnpmRegistry.ts
@@ -3,6 +3,7 @@ import http from 'node:http'
import os from 'node:os'
import path from 'node:path'
+import { afterAll, beforeAll, expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { prepare, preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/pnpm/test/install/preferOffline.ts b/pnpm/test/install/preferOffline.ts
index a319bcef7d..790b31c498 100644
--- a/pnpm/test/install/preferOffline.ts
+++ b/pnpm/test/install/preferOffline.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { prepare } from '@pnpm/prepare'
import { rimrafSync } from '@zkochan/rimraf'
diff --git a/pnpm/test/install/runtimeOnFail.ts b/pnpm/test/install/runtimeOnFail.ts
index ca296de962..b834e7df89 100644
--- a/pnpm/test/install/runtimeOnFail.ts
+++ b/pnpm/test/install/runtimeOnFail.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { execPnpm } from '../utils/index.js'
diff --git a/pnpm/test/install/selfUpdate.ts b/pnpm/test/install/selfUpdate.ts
index c0590627f1..6f40c0fed5 100644
--- a/pnpm/test/install/selfUpdate.ts
+++ b/pnpm/test/install/selfUpdate.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { loadJsonFileSync } from 'load-json-file'
diff --git a/pnpm/test/install/sideEffects.ts b/pnpm/test/install/sideEffects.ts
index e2382f622d..8a6278e869 100644
--- a/pnpm/test/install/sideEffects.ts
+++ b/pnpm/test/install/sideEffects.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { rimrafSync } from '@zkochan/rimraf'
diff --git a/pnpm/test/install/supportedArchitectures.ts b/pnpm/test/install/supportedArchitectures.ts
index eb53ee2dbf..da7c623e3e 100644
--- a/pnpm/test/install/supportedArchitectures.ts
+++ b/pnpm/test/install/supportedArchitectures.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { describe, expect, test } from '@jest/globals'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import type { WorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
diff --git a/pnpm/test/install/yesFlag.ts b/pnpm/test/install/yesFlag.ts
index f683275bd4..9c5e62de3c 100644
--- a/pnpm/test/install/yesFlag.ts
+++ b/pnpm/test/install/yesFlag.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { beforeEach, describe, expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { PackageManifest } from '@pnpm/types'
import { loadJsonFileSync } from 'load-json-file'
diff --git a/pnpm/test/list.ts b/pnpm/test/list.ts
index e9f3661b2c..f00cc68736 100644
--- a/pnpm/test/list.ts
+++ b/pnpm/test/list.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, preparePackages } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/monorepo/dedupePeers.test.ts b/pnpm/test/monorepo/dedupePeers.test.ts
index d2ba5edf61..d2934de5bb 100644
--- a/pnpm/test/monorepo/dedupePeers.test.ts
+++ b/pnpm/test/monorepo/dedupePeers.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import { createPeerDepGraphHash } from '@pnpm/deps.path'
import type { LockfileFile } from '@pnpm/lockfile.types'
diff --git a/pnpm/test/monorepo/index.ts b/pnpm/test/monorepo/index.ts
index 7ff98088fb..55b38f8cae 100644
--- a/pnpm/test/monorepo/index.ts
+++ b/pnpm/test/monorepo/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { Config } from '@pnpm/config.reader'
import { LOCKFILE_VERSION, WANTED_LOCKFILE } from '@pnpm/constants'
import { readModulesManifest } from '@pnpm/installing.modules-yaml'
diff --git a/pnpm/test/monorepo/peerDependencies.ts b/pnpm/test/monorepo/peerDependencies.ts
index bbb97afb9e..9cd96eaae3 100644
--- a/pnpm/test/monorepo/peerDependencies.ts
+++ b/pnpm/test/monorepo/peerDependencies.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { WANTED_LOCKFILE } from '@pnpm/constants'
import type { LockfileFile } from '@pnpm/lockfile.types'
import { preparePackages } from '@pnpm/prepare'
diff --git a/pnpm/test/packageManagerCheck.test.ts b/pnpm/test/packageManagerCheck.test.ts
index a4a1648a0c..0bef2bd188 100644
--- a/pnpm/test/packageManagerCheck.test.ts
+++ b/pnpm/test/packageManagerCheck.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/patch/allowUnusedPatches.ts b/pnpm/test/patch/allowUnusedPatches.ts
index 0aeb1a0578..acb697d219 100644
--- a/pnpm/test/patch/allowUnusedPatches.ts
+++ b/pnpm/test/patch/allowUnusedPatches.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/recursive/filter.ts b/pnpm/test/recursive/filter.ts
index 585bbc131e..881025f9e3 100644
--- a/pnpm/test/recursive/filter.ts
+++ b/pnpm/test/recursive/filter.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { execPnpmSync } from '../utils/index.js'
diff --git a/pnpm/test/recursive/misc.ts b/pnpm/test/recursive/misc.ts
index d619e6062c..6a9f18af27 100644
--- a/pnpm/test/recursive/misc.ts
+++ b/pnpm/test/recursive/misc.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { Config } from '@pnpm/config.reader'
import type { LockfileFile } from '@pnpm/lockfile.types'
import { preparePackages } from '@pnpm/prepare'
diff --git a/pnpm/test/recursive/rebuild.ts b/pnpm/test/recursive/rebuild.ts
index 9dc4b67eae..1fefa57ebc 100644
--- a/pnpm/test/recursive/rebuild.ts
+++ b/pnpm/test/recursive/rebuild.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/recursive/run.ts b/pnpm/test/recursive/run.ts
index c828dd0e9b..6fad3224ee 100644
--- a/pnpm/test/recursive/run.ts
+++ b/pnpm/test/recursive/run.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { createTestIpcServer } from '@pnpm/test-ipc-server'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/recursive/update.ts b/pnpm/test/recursive/update.ts
index bb9008cc09..4bd5f99d69 100644
--- a/pnpm/test/recursive/update.ts
+++ b/pnpm/test/recursive/update.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { Config } from '@pnpm/config.reader'
import { preparePackages } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
diff --git a/pnpm/test/root.ts b/pnpm/test/root.ts
index 73ddd9c47f..ee6a7e6972 100644
--- a/pnpm/test/root.ts
+++ b/pnpm/test/root.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { GLOBAL_LAYOUT_VERSION } from '@pnpm/constants'
import { tempDir } from '@pnpm/prepare'
import PATH_NAME from 'path-name'
diff --git a/pnpm/test/run.ts b/pnpm/test/run.ts
index a310b0418c..5a2fa4e9fd 100644
--- a/pnpm/test/run.ts
+++ b/pnpm/test/run.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, preparePackages } from '@pnpm/prepare'
import isWindows from 'is-windows'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/saveCatalog.ts b/pnpm/test/saveCatalog.ts
index 2fdca6df55..80ad1a5c5c 100644
--- a/pnpm/test/saveCatalog.ts
+++ b/pnpm/test/saveCatalog.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { LockfileFile } from '@pnpm/lockfile.types'
import { prepare, preparePackages } from '@pnpm/prepare'
import { addDistTag } from '@pnpm/registry-mock'
@@ -52,7 +53,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace
packages: {
'@pnpm.e2e/bar@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
await execPnpm(['add', '--save-catalog', '@pnpm.e2e/foo'])
expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({
@@ -86,7 +87,7 @@ test('--save-catalog adds catalogs to the manifest of a single package workspace
'@pnpm.e2e/bar@100.1.0': expect.anything(),
'@pnpm.e2e/foo@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({
catalog: {
'@pnpm.e2e/bar': '^100.1.0',
@@ -154,7 +155,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac
packages: {
'@pnpm.e2e/bar@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
await execPnpm(['--filter=project-1', 'add', '--save-catalog', '@pnpm.e2e/foo'])
expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({
@@ -192,7 +193,7 @@ test('--save-catalog adds catalogs to the manifest of a shared lockfile workspac
'@pnpm.e2e/bar@100.1.0': expect.anything(),
'@pnpm.e2e/foo@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({
catalog: {
'@pnpm.e2e/bar': '^100.1.0',
@@ -427,7 +428,7 @@ test('--save-catalog does not affect new dependencies from package.json', async
},
},
},
- } as Partial))
+ }))
// add a new dependency to package.json by editing it
project.writePackageJson({
@@ -436,7 +437,7 @@ test('--save-catalog does not affect new dependencies from package.json', async
...manifest.dependencies,
'@pnpm.e2e/pkg-b': '*',
},
- } as ProjectManifest)
+ })
// add a new dependency by running `pnpm add --save-catalog`
await execPnpm(['add', '--save-catalog', '@pnpm.e2e/pkg-c'])
@@ -481,7 +482,7 @@ test('--save-catalog does not affect new dependencies from package.json', async
'@pnpm.e2e/pkg-b': '*', // unaffected by `pnpm add --save-catalog`
'@pnpm.e2e/pkg-c': 'catalog:', // created by `pnpm add --save-catalog`
},
- } as ProjectManifest)
+ })
})
test('--save-catalog does not overwrite existing catalogs', async () => {
@@ -532,7 +533,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => {
},
'project-1': {},
},
- } as Partial))
+ }))
await execPnpm(['add', '--filter=project-1', '--save-catalog', '@pnpm.e2e/foo@100.1.0', '@pnpm.e2e/bar@100.1.0'])
expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({
@@ -570,7 +571,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => {
},
},
},
- } as Partial))
+ }))
expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({
catalog: {
'@pnpm.e2e/bar': '=100.0.0', // unchanged
@@ -586,7 +587,7 @@ test('--save-catalog does not overwrite existing catalogs', async () => {
'@pnpm.e2e/bar': '100.1.0',
'@pnpm.e2e/foo': 'catalog:',
},
- } as ProjectManifest)
+ })
})
test('--save-catalog creates new workspace manifest with the new catalog (recursive add)', async () => {
@@ -624,7 +625,7 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs
},
},
},
- } as Partial))
+ }))
expect(readYamlFileSync('project-1/pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({
catalogs: {
default: {
@@ -644,7 +645,7 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs
},
},
},
- } as Partial))
+ }))
expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({
catalog: {
@@ -658,14 +659,14 @@ test('--save-catalog creates new workspace manifest with the new catalog (recurs
...manifests[0].dependencies,
'@pnpm.e2e/foo': 'catalog:',
},
- } as ProjectManifest)
+ })
expect(loadJsonFileSync('project-1/package.json')).toStrictEqual({
...manifests[1],
dependencies: {
...manifests[1].dependencies,
'@pnpm.e2e/foo': 'catalog:',
},
- } as ProjectManifest)
+ })
})
test('--save-catalog-name', async () => {
@@ -712,7 +713,7 @@ test('--save-catalog-name', async () => {
packages: {
'@pnpm.e2e/bar@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
await execPnpm(['add', '--save-catalog-name=my-catalog', '@pnpm.e2e/foo'])
expect(readYamlFileSync('pnpm-lock.yaml')).toStrictEqual(expect.objectContaining({
@@ -748,7 +749,7 @@ test('--save-catalog-name', async () => {
'@pnpm.e2e/bar@100.1.0': expect.anything(),
'@pnpm.e2e/foo@100.1.0': expect.anything(),
},
- } as Partial))
+ }))
expect(readYamlFileSync('pnpm-workspace.yaml')).toStrictEqual({
catalog: {
'@pnpm.e2e/bar': '^100.1.0',
diff --git a/pnpm/test/sbom.ts b/pnpm/test/sbom.ts
index 34353d1bae..c60717fa4f 100644
--- a/pnpm/test/sbom.ts
+++ b/pnpm/test/sbom.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { execPnpm, execPnpmSync } from './utils/index.js'
diff --git a/pnpm/test/switchingVersions.test.ts b/pnpm/test/switchingVersions.test.ts
index 8ba9b3af06..84540d974e 100644
--- a/pnpm/test/switchingVersions.test.ts
+++ b/pnpm/test/switchingVersions.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import isWindows from 'is-windows'
import { writeJsonFileSync } from 'write-json-file'
diff --git a/pnpm/test/syncInjectedDepsAfterScripts-bin.ts b/pnpm/test/syncInjectedDepsAfterScripts-bin.ts
index 27d4c79826..935c1bd55b 100644
--- a/pnpm/test/syncInjectedDepsAfterScripts-bin.ts
+++ b/pnpm/test/syncInjectedDepsAfterScripts-bin.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/syncInjectedDepsAfterScripts.ts b/pnpm/test/syncInjectedDepsAfterScripts.ts
index 4deda5e2cc..d44fa60ea5 100644
--- a/pnpm/test/syncInjectedDepsAfterScripts.ts
+++ b/pnpm/test/syncInjectedDepsAfterScripts.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import { writeYamlFileSync } from 'write-yaml-file'
diff --git a/pnpm/test/uninstall.ts b/pnpm/test/uninstall.ts
index ce6e72fa0a..a2afbcc49f 100644
--- a/pnpm/test/uninstall.ts
+++ b/pnpm/test/uninstall.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader'
import { prepare } from '@pnpm/prepare'
import PATH from 'path-name'
diff --git a/pnpm/test/update.ts b/pnpm/test/update.ts
index d26f6eb4d5..5f14f11c37 100644
--- a/pnpm/test/update.ts
+++ b/pnpm/test/update.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { readPackageJsonFromDir } from '@pnpm/pkg-manifest.reader'
import { prepare, preparePackages } from '@pnpm/prepare'
import { readYamlFileSync } from 'read-yaml-file'
diff --git a/pnpm/test/verifyDepsBeforeRun/exec.ts b/pnpm/test/verifyDepsBeforeRun/exec.ts
index 5433229964..f8b7d3f0df 100644
--- a/pnpm/test/verifyDepsBeforeRun/exec.ts
+++ b/pnpm/test/verifyDepsBeforeRun/exec.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, preparePackages } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { loadWorkspaceState } from '@pnpm/workspace.state'
diff --git a/pnpm/test/verifyDepsBeforeRun/install.ts b/pnpm/test/verifyDepsBeforeRun/install.ts
index 586a311ecc..fb5f24aea8 100644
--- a/pnpm/test/verifyDepsBeforeRun/install.ts
+++ b/pnpm/test/verifyDepsBeforeRun/install.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { loadWorkspaceState } from '@pnpm/workspace.state'
diff --git a/pnpm/test/verifyDepsBeforeRun/issue-9424.ts b/pnpm/test/verifyDepsBeforeRun/issue-9424.ts
index 0748f8a7a9..89ab759be8 100644
--- a/pnpm/test/verifyDepsBeforeRun/issue-9424.ts
+++ b/pnpm/test/verifyDepsBeforeRun/issue-9424.ts
@@ -1,9 +1,10 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
-import { loadWorkspaceState, type WorkspaceState } from '@pnpm/workspace.state'
+import { loadWorkspaceState } from '@pnpm/workspace.state'
import { writeYamlFileSync } from 'write-yaml-file'
import { execPnpm, execPnpmSync } from '../utils/index.js'
@@ -60,7 +61,7 @@ test('hoisted node linker and node_modules not exist (#9424)', async () => {
settings: {
nodeLinker: 'hoisted',
},
- } as Partial)
+ })
// pnpm install creates a node_modules at root, but none in the workspace members
expect(fs.readdirSync(process.cwd())).toContain('node_modules')
diff --git a/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts b/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts
index 408a717556..da5e8d12ba 100644
--- a/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts
+++ b/pnpm/test/verifyDepsBeforeRun/multiProjectWorkspace.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { preparePackages } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { loadWorkspaceState } from '@pnpm/workspace.state'
diff --git a/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts b/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts
index a6327f0389..75112c66e0 100644
--- a/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts
+++ b/pnpm/test/verifyDepsBeforeRun/singleProjectWorkspace.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { loadWorkspaceState } from '@pnpm/workspace.state'
diff --git a/pnpm/test/withCommand.test.ts b/pnpm/test/withCommand.test.ts
index c75af70748..ac1984a59d 100644
--- a/pnpm/test/withCommand.test.ts
+++ b/pnpm/test/withCommand.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { writeJsonFileSync } from 'write-json-file'
diff --git a/registry-access/commands/test/deprecate.ts b/registry-access/commands/test/deprecate.ts
index f5dd536cf5..fd1257d2d3 100644
--- a/registry-access/commands/test/deprecate.ts
+++ b/registry-access/commands/test/deprecate.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { deprecate, undeprecate } from '@pnpm/registry-access.commands'
import { REGISTRY_MOCK_CREDENTIALS, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/registry-access/commands/test/dist-tag.ts b/registry-access/commands/test/dist-tag.ts
index e52a1d1383..09b60f3a7a 100644
--- a/registry-access/commands/test/dist-tag.ts
+++ b/registry-access/commands/test/dist-tag.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { distTag } from '@pnpm/registry-access.commands'
import { REGISTRY_MOCK_CREDENTIALS, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/registry-access/commands/test/search.ts b/registry-access/commands/test/search.ts
index c7ac918a95..c46a00b946 100644
--- a/registry-access/commands/test/search.ts
+++ b/registry-access/commands/test/search.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { search } from '@pnpm/registry-access.commands'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
import { DEFAULT_OPTS } from '@pnpm/testing.command-defaults'
diff --git a/registry-access/commands/test/unpublish.ts b/registry-access/commands/test/unpublish.ts
index 8cdf733e1a..821c47860f 100644
--- a/registry-access/commands/test/unpublish.ts
+++ b/registry-access/commands/test/unpublish.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { prepare } from '@pnpm/prepare'
import { unpublish } from '@pnpm/registry-access.commands'
import { REGISTRY_MOCK_CREDENTIALS, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/releasing/commands/test/deploy/deploy.test.ts b/releasing/commands/test/deploy/deploy.test.ts
index c4c924c4fc..a29527dc8c 100644
--- a/releasing/commands/test/deploy/deploy.test.ts
+++ b/releasing/commands/test/deploy/deploy.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { install } from '@pnpm/installing.commands'
import { preparePackages } from '@pnpm/prepare'
diff --git a/releasing/commands/test/deploy/deployHook.test.ts b/releasing/commands/test/deploy/deployHook.test.ts
index b4e5cb1329..4ba3146690 100644
--- a/releasing/commands/test/deploy/deployHook.test.ts
+++ b/releasing/commands/test/deploy/deployHook.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { deployHook } from '../../src/deploy/deployHook.js'
test('deployHook()', () => {
diff --git a/releasing/commands/test/deploy/shared-lockfile.test.ts b/releasing/commands/test/deploy/shared-lockfile.test.ts
index ab4af31334..0a608a563d 100644
--- a/releasing/commands/test/deploy/shared-lockfile.test.ts
+++ b/releasing/commands/test/deploy/shared-lockfile.test.ts
@@ -2,10 +2,9 @@ import fs from 'node:fs'
import path from 'node:path'
import url from 'node:url'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { assertProject } from '@pnpm/assert-project'
import { install } from '@pnpm/installing.commands'
-import type { LockfileFile, LockfilePackageSnapshot } from '@pnpm/lockfile.types'
import { preparePackages } from '@pnpm/prepare'
import { fixtures } from '@pnpm/test-fixtures'
import type { ProjectManifest } from '@pnpm/types'
@@ -121,7 +120,7 @@ test('deploy with a shared lockfile after full install', async () => {
})
expect(fs.existsSync('pnpm-lock.yaml')).toBeTruthy()
- const expectedDeployManifest: ProjectManifest = {
+ const expectedDeployManifest = {
name: 'project-1',
version: '1.0.0',
dependencies: {
@@ -347,7 +346,7 @@ test('the deploy manifest should inherit some fields from the pnpm object from t
},
},
},
- } as LockfileFile['importers'])
+ })
})
test('deploy with a shared lockfile and --prod filter should not fail even if dev workspace package does not exist (#8778)', async () => {
@@ -450,7 +449,7 @@ test('deploy with a shared lockfile and --prod filter should not fail even if de
},
},
},
- } as LockfileFile['importers'])
+ })
const manifest = readPackageJson('deploy') as ProjectManifest
expect(manifest).toStrictEqual({
@@ -465,7 +464,7 @@ test('deploy with a shared lockfile and --prod filter should not fail even if de
'is-negative': '1.0.0',
},
optionalDependencies: {},
- } as ProjectManifest)
+ })
const prod1Name = fs.readdirSync('deploy/node_modules/.pnpm').find(name => name.includes('prod-1@'))
expect(prod1Name).toBeDefined()
@@ -535,7 +534,7 @@ test('deploy with a shared lockfile should correctly handle workspace dependenci
},
},
},
- } as LockfileFile['importers'])
+ })
const manifest = readPackageJson('deploy') as ProjectManifest
expect(manifest).toStrictEqual({
@@ -547,7 +546,7 @@ test('deploy with a shared lockfile should correctly handle workspace dependenci
},
devDependencies: {},
optionalDependencies: {},
- } as ProjectManifest)
+ })
const project1Name = fs.readdirSync('deploy/node_modules/.pnpm').find(name => name.includes('project-1@'))
expect(project1Name).toBeDefined()
@@ -622,7 +621,7 @@ test('deploy with a shared lockfile should correctly handle package that depends
},
},
},
- } as LockfileFile['importers'])
+ })
const manifest = readPackageJson('deploy') as ProjectManifest
expect(manifest).toStrictEqual({
@@ -636,7 +635,7 @@ test('deploy with a shared lockfile should correctly handle package that depends
},
devDependencies: {},
optionalDependencies: {},
- } as ProjectManifest)
+ })
expect(fs.realpathSync('deploy/node_modules/project-0')).toBe(path.resolve('deploy'))
expect(fs.realpathSync('deploy/node_modules/renamed-workspace')).toBe(path.resolve('deploy'))
@@ -730,7 +729,7 @@ test('deploy with a shared lockfile should correctly handle packageExtensions',
'project-0': 'link:.',
'project-1': expect.stringMatching(/^project-1@file:/),
},
- } as LockfilePackageSnapshot)
+ })
const manifest = readPackageJson('deploy') as ProjectManifest
expect(manifest).toStrictEqual({
@@ -741,7 +740,7 @@ test('deploy with a shared lockfile should correctly handle packageExtensions',
},
devDependencies: {},
optionalDependencies: {},
- } as ProjectManifest)
+ })
const project1Name = fs.readdirSync('deploy/node_modules/.pnpm').find(name => name.includes('project-1@'))
expect(project1Name).toBeDefined()
@@ -856,7 +855,7 @@ test('deploy with a shared lockfile should correctly handle patchedDependencies'
},
devDependencies: {},
optionalDependencies: {},
- } as ProjectManifest)
+ })
// patchedDependencies should be written to pnpm-workspace.yaml
const workspaceManifestPath = path.resolve('deploy', 'pnpm-workspace.yaml')
@@ -1045,7 +1044,7 @@ test('deploy with a shared lockfile that has peer dependencies suffix in workspa
'project-1': '*',
'project-2': '*',
},
- } as ProjectManifest)
+ })
expect(readPackageJson('deploy/node_modules/project-1')).toStrictEqual(preparedManifests['project-1'])
expect(readPackageJson('deploy/node_modules/project-2')).toStrictEqual(preparedManifests['project-2'])
diff --git a/releasing/commands/test/publish/FailedToPublishError.test.ts b/releasing/commands/test/publish/FailedToPublishError.test.ts
index 94e1378af9..14f4826041 100644
--- a/releasing/commands/test/publish/FailedToPublishError.test.ts
+++ b/releasing/commands/test/publish/FailedToPublishError.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import { createFailedToPublishError, type FailedToPublishError } from '../../src/publish/FailedToPublishError.js'
import type { PackResult } from '../../src/publish/pack.js'
diff --git a/releasing/commands/test/publish/executeTokenHelper.test.ts b/releasing/commands/test/publish/executeTokenHelper.test.ts
index 5982d67ab0..b40d1fb656 100644
--- a/releasing/commands/test/publish/executeTokenHelper.test.ts
+++ b/releasing/commands/test/publish/executeTokenHelper.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { executeTokenHelper } from '../../src/publish/executeTokenHelper.js'
diff --git a/releasing/commands/test/publish/extractManifestFromPacked.test.ts b/releasing/commands/test/publish/extractManifestFromPacked.test.ts
index b9935eab43..f9b2f9db67 100644
--- a/releasing/commands/test/publish/extractManifestFromPacked.test.ts
+++ b/releasing/commands/test/publish/extractManifestFromPacked.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import { createGzip } from 'node:zlib'
+import { describe, expect, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import type { ExportedManifest } from '@pnpm/releasing.exportable-manifest'
import tar from 'tar-stream'
diff --git a/releasing/commands/test/publish/gitChecks.ts b/releasing/commands/test/publish/gitChecks.ts
index 24ebe9aac0..46ab559a5d 100644
--- a/releasing/commands/test/publish/gitChecks.ts
+++ b/releasing/commands/test/publish/gitChecks.ts
@@ -1,6 +1,6 @@
import fs from 'node:fs'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
import { safeExeca as execa } from 'execa'
diff --git a/releasing/commands/test/publish/oidcAuthToken.test.ts b/releasing/commands/test/publish/oidcAuthToken.test.ts
index de84d6b4e8..4fe51693ea 100644
--- a/releasing/commands/test/publish/oidcAuthToken.test.ts
+++ b/releasing/commands/test/publish/oidcAuthToken.test.ts
@@ -1,10 +1,9 @@
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import {
type AuthTokenContext,
AuthTokenExchangeError,
AuthTokenFetchError,
- type AuthTokenFetchOptions,
AuthTokenJsonInterruptedError,
AuthTokenMalformedJsonError,
fetchAuthToken,
@@ -16,7 +15,7 @@ describe('fetchAuthToken', () => {
const idToken = 'test-id-token'
test('successfully fetches auth token', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ token: 'fetched-auth-token' }),
@@ -41,12 +40,12 @@ describe('fetchAuthToken', () => {
},
body: '',
method: 'POST',
- } as AuthTokenFetchOptions)
+ })
)
})
test('encodes package name in URL', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ token: 'token' }),
@@ -66,7 +65,7 @@ describe('fetchAuthToken', () => {
})
test('passes fetch options correctly', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ token: 'token' }),
@@ -109,7 +108,7 @@ describe('fetchAuthToken', () => {
test('throws AuthTokenFetchError when fetch fails', async () => {
const fetchError = new Error('Network error')
- const mockFetch = jest.fn(async () => {
+ const mockFetch = jest.fn(async () => {
throw fetchError
})
@@ -127,7 +126,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenExchangeError when response is not ok and returns a payload of error', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 401,
json: async () => ({ body: { message: 'Unauthorized' } }),
@@ -150,7 +149,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenExchangeError when response is not ok and the returned payload could not be fetched', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 401,
json: async () => {
@@ -175,7 +174,7 @@ describe('fetchAuthToken', () => {
})
test('handles exchange error with missing body message', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 403,
json: async () => ({}),
@@ -196,7 +195,7 @@ describe('fetchAuthToken', () => {
})
test('handles exchange error when json response is valid', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 500,
json: async () => ({ body: { message: 'Internal Server Error' } }),
@@ -215,7 +214,7 @@ describe('fetchAuthToken', () => {
test('throws AuthTokenJsonInterruptedError when JSON parsing fails on success response', async () => {
const jsonError = new Error('JSON parse error')
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => {
@@ -235,7 +234,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenMalformedJsonError when JSON response is missing token', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({}),
@@ -255,7 +254,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenMalformedJsonError when token is not a string', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ token: 12345 }),
@@ -269,7 +268,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenMalformedJsonError when JSON response is null', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => null,
@@ -283,7 +282,7 @@ describe('fetchAuthToken', () => {
})
test('throws AuthTokenMalformedJsonError when JSON response is not an object', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => 'string response',
diff --git a/releasing/commands/test/publish/oidcIdToken.test.ts b/releasing/commands/test/publish/oidcIdToken.test.ts
index e842ae6d3a..12577ca7ef 100644
--- a/releasing/commands/test/publish/oidcIdToken.test.ts
+++ b/releasing/commands/test/publish/oidcIdToken.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import {
getIdToken,
@@ -110,7 +110,7 @@ describe('getIdToken', () => {
})
test('fetches ID token from GitHub Actions successfully', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ value: 'fetched-id-token' }),
@@ -147,7 +147,7 @@ describe('getIdToken', () => {
})
test('passes fetch options correctly', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ value: 'token' }),
@@ -192,7 +192,7 @@ describe('getIdToken', () => {
})
test('logs fetch information via globalInfo', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ value: 'token' }),
@@ -227,7 +227,7 @@ describe('getIdToken', () => {
})
test('throws error when fetch response is not ok', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 401,
json: async () => ({ code: 'UNAUTHORIZED', message: 'Unauthorized' }),
@@ -250,7 +250,7 @@ describe('getIdToken', () => {
})
test('throws error when JSON parsing fails', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => {
@@ -275,7 +275,7 @@ describe('getIdToken', () => {
})
test('throws error when JSON response is missing value field', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({}),
@@ -298,7 +298,7 @@ describe('getIdToken', () => {
})
test('throws error when JSON response value is not a string', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ value: 123 }),
@@ -321,7 +321,7 @@ describe('getIdToken', () => {
})
test('throws error when JSON response is null', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => null,
diff --git a/releasing/commands/test/publish/oidcProvenance.test.ts b/releasing/commands/test/publish/oidcProvenance.test.ts
index c214804a6a..8a42474134 100644
--- a/releasing/commands/test/publish/oidcProvenance.test.ts
+++ b/releasing/commands/test/publish/oidcProvenance.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import {
determineProvenance,
@@ -121,7 +121,7 @@ describe('determineProvenance', () => {
})
test('returns true when package is public in GitHub Actions', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ public: true }),
@@ -166,7 +166,7 @@ describe('determineProvenance', () => {
})
test('returns true when package is public in GitLab', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ public: true }),
@@ -193,7 +193,7 @@ describe('determineProvenance', () => {
})
test('returns undefined when package visibility is not public', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ public: false }),
@@ -219,7 +219,7 @@ describe('determineProvenance', () => {
})
test('returns undefined when visibility response is missing public field', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({}),
@@ -245,7 +245,7 @@ describe('determineProvenance', () => {
})
test('passes fetch options correctly', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ public: true }),
@@ -292,7 +292,7 @@ describe('determineProvenance', () => {
})
test('throws ProvenanceFailedToFetchVisibilityError when fetch fails', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 404,
json: async () => ({ code: 'NOT_FOUND', message: 'Package not found' }),
@@ -335,7 +335,7 @@ describe('determineProvenance', () => {
})
test('handles visibility fetch error with only code', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 401,
json: async () => ({ code: 'UNAUTHORIZED' }),
@@ -365,7 +365,7 @@ describe('determineProvenance', () => {
})
test('handles visibility fetch error with only message', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 500,
json: async () => ({ message: 'Internal server error' }),
@@ -395,7 +395,7 @@ describe('determineProvenance', () => {
})
test('handles visibility fetch error with no error details', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 503,
json: async () => ({}),
@@ -425,7 +425,7 @@ describe('determineProvenance', () => {
})
test('handles visibility fetch error when JSON parsing fails', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: false,
status: 500,
json: async () => {
@@ -455,7 +455,7 @@ describe('determineProvenance', () => {
})
test('encodes package name in URL', async () => {
- const mockFetch = jest.fn(async () => ({
+ const mockFetch = jest.fn(async () => ({
ok: true,
status: 200,
json: async () => ({ public: true }),
diff --git a/releasing/commands/test/publish/optEnv.test.ts b/releasing/commands/test/publish/optEnv.test.ts
index fcd343156d..861674a833 100644
--- a/releasing/commands/test/publish/optEnv.test.ts
+++ b/releasing/commands/test/publish/optEnv.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import { optionsWithOtpEnv } from '../../src/publish/otpEnv.js'
describe('optionsWithOtpEnv', () => {
diff --git a/releasing/commands/test/publish/otp.test.ts b/releasing/commands/test/publish/otp.test.ts
index 59dd0d29c1..e8ada5c4b8 100644
--- a/releasing/commands/test/publish/otp.test.ts
+++ b/releasing/commands/test/publish/otp.test.ts
@@ -1,4 +1,4 @@
-import { jest } from '@jest/globals'
+import { describe, expect, it, jest } from '@jest/globals'
import {
OtpNonInteractiveError,
OtpSecondChallengeError,
diff --git a/releasing/commands/test/publish/pack.ts b/releasing/commands/test/publish/pack.ts
index 7b1a0aceb8..9b7788719a 100644
--- a/releasing/commands/test/publish/pack.ts
+++ b/releasing/commands/test/publish/pack.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { beforeAll, describe, expect, test } from '@jest/globals'
import { prepare, preparePackages, tempDir } from '@pnpm/prepare'
import { pack } from '@pnpm/releasing.commands'
import { filterProjectsBySelectorObjectsFromDir } from '@pnpm/workspace.projects-filter'
diff --git a/releasing/commands/test/publish/publish.ts b/releasing/commands/test/publish/publish.ts
index b0f5a5e11b..c90506c71f 100644
--- a/releasing/commands/test/publish/publish.ts
+++ b/releasing/commands/test/publish/publish.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config'
import { prepare, preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_CREDENTIALS, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/releasing/commands/test/publish/recursivePublish.ts b/releasing/commands/test/publish/recursivePublish.ts
index 074e7ca7f2..1ed6ce075c 100644
--- a/releasing/commands/test/publish/recursivePublish.ts
+++ b/releasing/commands/test/publish/recursivePublish.ts
@@ -1,6 +1,6 @@
import fs from 'node:fs'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { streamParser } from '@pnpm/logger'
import { preparePackages } from '@pnpm/prepare'
import { REGISTRY_MOCK_CREDENTIALS, REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/releasing/commands/test/publish/registryConfigKeys.test.ts b/releasing/commands/test/publish/registryConfigKeys.test.ts
index 8a57cc3db4..02d6edea13 100644
--- a/releasing/commands/test/publish/registryConfigKeys.test.ts
+++ b/releasing/commands/test/publish/registryConfigKeys.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import {
allRegistryConfigKeys,
type NormalizedRegistryUrl,
diff --git a/releasing/commands/test/publish/utils/index.ts b/releasing/commands/test/publish/utils/index.ts
index 21139f8af0..c8e92d3cc4 100644
--- a/releasing/commands/test/publish/utils/index.ts
+++ b/releasing/commands/test/publish/utils/index.ts
@@ -1,3 +1,4 @@
+import { expect } from '@jest/globals'
import { DEFAULT_OPTS as BASE_OPTS, REGISTRY_URL } from '@pnpm/testing.command-defaults'
import { safeExeca as execa } from 'execa'
diff --git a/releasing/exportable-manifest/package.json b/releasing/exportable-manifest/package.json
index 40e64dbf72..2fa29864cf 100644
--- a/releasing/exportable-manifest/package.json
+++ b/releasing/exportable-manifest/package.json
@@ -42,6 +42,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/catalogs.config": "workspace:*",
"@pnpm/catalogs.types": "workspace:*",
"@pnpm/hooks.pnpmfile": "workspace:*",
diff --git a/releasing/exportable-manifest/test/beforePackingHook.test.ts b/releasing/exportable-manifest/test/beforePackingHook.test.ts
index 5e79842ceb..fa71a55067 100644
--- a/releasing/exportable-manifest/test/beforePackingHook.test.ts
+++ b/releasing/exportable-manifest/test/beforePackingHook.test.ts
@@ -1,5 +1,6 @@
import fs from 'node:fs'
+import { expect, test } from '@jest/globals'
import { requireHooks } from '@pnpm/hooks.pnpmfile'
import { prepare } from '@pnpm/prepare'
import { createExportableManifest, type MakePublishManifestOptions } from '@pnpm/releasing.exportable-manifest'
diff --git a/releasing/exportable-manifest/test/index.test.ts b/releasing/exportable-manifest/test/index.test.ts
index 89d0a3fc99..70ae697fda 100644
--- a/releasing/exportable-manifest/test/index.test.ts
+++ b/releasing/exportable-manifest/test/index.test.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config'
import { preparePackages } from '@pnpm/prepare'
import { createExportableManifest, type MakePublishManifestOptions } from '@pnpm/releasing.exportable-manifest'
diff --git a/releasing/exportable-manifest/test/normalizeBinObject.test.ts b/releasing/exportable-manifest/test/normalizeBinObject.test.ts
index cc335ed0e1..c518eb0044 100644
--- a/releasing/exportable-manifest/test/normalizeBinObject.test.ts
+++ b/releasing/exportable-manifest/test/normalizeBinObject.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { normalizeBinObject } from '../lib/transform/bin.js'
test('string', () => {
diff --git a/releasing/exportable-manifest/test/overridePublishConfig.test.ts b/releasing/exportable-manifest/test/overridePublishConfig.test.ts
index ebc2b569fb..0618b11496 100644
--- a/releasing/exportable-manifest/test/overridePublishConfig.test.ts
+++ b/releasing/exportable-manifest/test/overridePublishConfig.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { PackageManifest, PublishConfig } from '@pnpm/types'
import { overridePublishConfig } from '../lib/overridePublishConfig.js'
diff --git a/releasing/exportable-manifest/test/transformPeerDependenciesMeta.test.ts b/releasing/exportable-manifest/test/transformPeerDependenciesMeta.test.ts
index 3027728709..4c19de45ce 100644
--- a/releasing/exportable-manifest/test/transformPeerDependenciesMeta.test.ts
+++ b/releasing/exportable-manifest/test/transformPeerDependenciesMeta.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import type { ProjectManifest } from '@pnpm/types'
import { transformPeerDependenciesMeta } from '../lib/transform/peerDependenciesMeta.js'
diff --git a/resolving/default-resolver/test/customResolver.ts b/resolving/default-resolver/test/customResolver.ts
index 6844466324..c7a9fbbc44 100644
--- a/resolving/default-resolver/test/customResolver.ts
+++ b/resolving/default-resolver/test/customResolver.ts
@@ -1,5 +1,5 @@
///
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import type { CustomResolver, WantedDependency } from '@pnpm/hooks.types'
import { createResolver } from '@pnpm/resolving.default-resolver'
@@ -160,7 +160,7 @@ test('custom resolver error handling', async () => {
})
test('preferredVersions are passed to custom resolver', async () => {
- const resolve = jest.fn(() => ({
+ const resolve = jest.fn>(() => ({
id: 'test@1.0.0',
resolution: { tarball: 'file://test.tgz', integrity: 'sha512-test' },
}))
@@ -185,7 +185,14 @@ test('preferredVersions are passed to custom resolver', async () => {
{ lockfileDir: '/test', projectDir: '/test', preferredVersions: { any: { '1.0.0': 'version' } } as unknown as Record> }
)
- expect(resolve).toHaveBeenCalledWith({ alias: 'any', bareSpecifier: '1.0.0' }, { lockfileDir: '/test', projectDir: '/test', preferredVersions: { any: { '1.0.0': 'version' } } })
+ expect(resolve).toHaveBeenCalledWith(
+ { alias: 'any', bareSpecifier: '1.0.0' },
+ expect.objectContaining({
+ lockfileDir: '/test',
+ projectDir: '/test',
+ preferredVersions: { any: { '1.0.0': 'version' } },
+ })
+ )
})
test('custom resolver can intercept any protocol', async () => {
diff --git a/resolving/default-resolver/test/index.ts b/resolving/default-resolver/test/index.ts
index 1bd20adf75..efb0d77603 100644
--- a/resolving/default-resolver/test/index.ts
+++ b/resolving/default-resolver/test/index.ts
@@ -1,4 +1,5 @@
///
+import { expect, test } from '@jest/globals'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createResolver } from '@pnpm/resolving.default-resolver'
diff --git a/resolving/git-resolver/test/createGitHostedPkgId.test.ts b/resolving/git-resolver/test/createGitHostedPkgId.test.ts
index a48cac25e1..9b1ca9a8c5 100644
--- a/resolving/git-resolver/test/createGitHostedPkgId.test.ts
+++ b/resolving/git-resolver/test/createGitHostedPkgId.test.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { createGitHostedPkgId } from '@pnpm/resolving.git-resolver'
test.each([
diff --git a/resolving/git-resolver/test/index.ts b/resolving/git-resolver/test/index.ts
index 9596da7040..460c23bc93 100644
--- a/resolving/git-resolver/test/index.ts
+++ b/resolving/git-resolver/test/index.ts
@@ -1,7 +1,7 @@
///
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import isWindows from 'is-windows'
const { fetchWithDispatcher: fetchWithDispatcherOriginal } = await import('@pnpm/network.fetch')
diff --git a/resolving/git-resolver/test/parsePref.test.ts b/resolving/git-resolver/test/parsePref.test.ts
index 12af531464..860df9881f 100644
--- a/resolving/git-resolver/test/parsePref.test.ts
+++ b/resolving/git-resolver/test/parsePref.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { parseBareSpecifier } from '../lib/parseBareSpecifier.js'
test.each([
diff --git a/resolving/jsr-specifier-parser/package.json b/resolving/jsr-specifier-parser/package.json
index 0929fe3b46..e70326ce08 100644
--- a/resolving/jsr-specifier-parser/package.json
+++ b/resolving/jsr-specifier-parser/package.json
@@ -35,6 +35,7 @@
"@pnpm/error": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/resolving.jsr-specifier-parser": "workspace:*"
},
"engines": {
diff --git a/resolving/jsr-specifier-parser/test/parse.test.ts b/resolving/jsr-specifier-parser/test/parse.test.ts
index f7aae13356..c0afc8b60b 100644
--- a/resolving/jsr-specifier-parser/test/parse.test.ts
+++ b/resolving/jsr-specifier-parser/test/parse.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { type JsrSpec, parseJsrSpecifier } from '@pnpm/resolving.jsr-specifier-parser'
describe('parseJsrSpecifier', () => {
diff --git a/resolving/local-resolver/test/index.ts b/resolving/local-resolver/test/index.ts
index 42920bb4a3..8c578f30f4 100644
--- a/resolving/local-resolver/test/index.ts
+++ b/resolving/local-resolver/test/index.ts
@@ -2,7 +2,7 @@
import { createRequire } from 'node:module'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { logger } from '@pnpm/logger'
import { resolveFromLocal } from '@pnpm/resolving.local-resolver'
import type { DirectoryResolution } from '@pnpm/resolving.resolver-base'
@@ -166,14 +166,10 @@ test('resolve file with different integrity (forceFetch)', async () => {
})
test('fail when resolving tarball specified with the link: protocol', async () => {
- try {
- const wantedDependency = { bareSpecifier: 'link:./pnpm-local-resolver-0.1.1.tgz' }
- await resolveFromLocal({}, wantedDependency, { projectDir: TEST_DIR })
- fail()
- } catch (err: any) { // eslint-disable-line
- expect(err).toBeDefined()
- expect(err.code).toBe('ERR_PNPM_NOT_PACKAGE_DIRECTORY')
- }
+ const wantedDependency = { bareSpecifier: 'link:./pnpm-local-resolver-0.1.1.tgz' }
+ await expect(
+ resolveFromLocal({}, wantedDependency, { projectDir: TEST_DIR })
+ ).rejects.toMatchObject({ code: 'ERR_PNPM_NOT_PACKAGE_DIRECTORY' })
})
test('fail when resolving from not existing directory an injected dependency', async () => {
@@ -200,13 +196,11 @@ test('do not fail when resolving from not existing directory', async () => {
})
test('throw error when the path: protocol is used', async () => {
- try {
- await resolveFromLocal({}, { bareSpecifier: 'path:..' }, { projectDir: import.meta.dirname })
- fail()
- } catch (err: any) { // eslint-disable-line
- expect(err).toBeDefined()
- expect(err.code).toBe('ERR_PNPM_PATH_IS_UNSUPPORTED_PROTOCOL')
- expect(err.bareSpecifier).toBe('path:..')
- expect(err.protocol).toBe('path:')
- }
+ await expect(
+ resolveFromLocal({}, { bareSpecifier: 'path:..' }, { projectDir: import.meta.dirname })
+ ).rejects.toMatchObject({
+ code: 'ERR_PNPM_PATH_IS_UNSUPPORTED_PROTOCOL',
+ bareSpecifier: 'path:..',
+ protocol: 'path:',
+ })
})
diff --git a/resolving/npm-resolver/package.json b/resolving/npm-resolver/package.json
index 3accf569ce..1571143140 100644
--- a/resolving/npm-resolver/package.json
+++ b/resolving/npm-resolver/package.json
@@ -69,6 +69,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/config.version-policy": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/network.fetch": "workspace:*",
diff --git a/resolving/npm-resolver/test/clearCache.test.ts b/resolving/npm-resolver/test/clearCache.test.ts
index 1a550bb7a1..63c8a0233b 100644
--- a/resolving/npm-resolver/test/clearCache.test.ts
+++ b/resolving/npm-resolver/test/clearCache.test.ts
@@ -1,3 +1,4 @@
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
import type { PackageMeta } from '@pnpm/resolving.registry.types'
diff --git a/resolving/npm-resolver/test/distTagsByDate.test.ts b/resolving/npm-resolver/test/distTagsByDate.test.ts
index 1dfda1e30a..afcbf26c69 100644
--- a/resolving/npm-resolver/test/distTagsByDate.test.ts
+++ b/resolving/npm-resolver/test/distTagsByDate.test.ts
@@ -1,3 +1,4 @@
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
import type { Registries } from '@pnpm/types'
diff --git a/resolving/npm-resolver/test/ifModifiedSince.test.ts b/resolving/npm-resolver/test/ifModifiedSince.test.ts
index 889c5422d6..b210b4f471 100644
--- a/resolving/npm-resolver/test/ifModifiedSince.test.ts
+++ b/resolving/npm-resolver/test/ifModifiedSince.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { ABBREVIATED_META_DIR } from '@pnpm/constants'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
diff --git a/resolving/npm-resolver/test/index.ts b/resolving/npm-resolver/test/index.ts
index f1c25009bf..3731572791 100644
--- a/resolving/npm-resolver/test/index.ts
+++ b/resolving/npm-resolver/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { ABBREVIATED_META_DIR } from '@pnpm/constants'
import { createHexHash } from '@pnpm/crypto.hash'
import { PnpmError } from '@pnpm/error'
diff --git a/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts b/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts
index 5ad05234ae..4a25b4ba85 100644
--- a/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts
+++ b/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { normalizeRegistryUrl } from '../lib/normalizeRegistryUrl.js'
test.each([
diff --git a/resolving/npm-resolver/test/optionalDependencies.test.ts b/resolving/npm-resolver/test/optionalDependencies.test.ts
index dffcae6c55..6867da92f0 100644
--- a/resolving/npm-resolver/test/optionalDependencies.test.ts
+++ b/resolving/npm-resolver/test/optionalDependencies.test.ts
@@ -1,4 +1,5 @@
///
+import { afterEach, beforeEach, describe, expect, test } from '@jest/globals'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
import type { Registries } from '@pnpm/types'
diff --git a/resolving/npm-resolver/test/publishedBy.test.ts b/resolving/npm-resolver/test/publishedBy.test.ts
index 1f80b4d540..cf80c5073b 100644
--- a/resolving/npm-resolver/test/publishedBy.test.ts
+++ b/resolving/npm-resolver/test/publishedBy.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { ABBREVIATED_META_DIR, FULL_FILTERED_META_DIR } from '@pnpm/constants'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
diff --git a/resolving/npm-resolver/test/resolveJsr.test.ts b/resolving/npm-resolver/test/resolveJsr.test.ts
index bc9e2c9b32..f33e781d72 100644
--- a/resolving/npm-resolver/test/resolveJsr.test.ts
+++ b/resolving/npm-resolver/test/resolveJsr.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { afterEach, beforeEach, expect, test } from '@jest/globals'
import { ABBREVIATED_META_DIR } from '@pnpm/constants'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { createNpmResolver } from '@pnpm/resolving.npm-resolver'
diff --git a/resolving/npm-resolver/test/trustChecks.test.ts b/resolving/npm-resolver/test/trustChecks.test.ts
index 4a30d0f7ae..7e8b629d9e 100644
--- a/resolving/npm-resolver/test/trustChecks.test.ts
+++ b/resolving/npm-resolver/test/trustChecks.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { createPackageVersionPolicy } from '@pnpm/config.version-policy'
import type { PackageInRegistry, PackageMetaWithTime } from '@pnpm/resolving.registry.types'
diff --git a/resolving/npm-resolver/test/whichVersionIsPinned.test.ts b/resolving/npm-resolver/test/whichVersionIsPinned.test.ts
index b1f8950678..499e28872f 100644
--- a/resolving/npm-resolver/test/whichVersionIsPinned.test.ts
+++ b/resolving/npm-resolver/test/whichVersionIsPinned.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { whichVersionIsPinned } from '../lib/whichVersionIsPinned.js'
test.each([
diff --git a/resolving/npm-resolver/test/workspacePrefToNpm.test.ts b/resolving/npm-resolver/test/workspacePrefToNpm.test.ts
index 434ac8310a..00e2bfb271 100644
--- a/resolving/npm-resolver/test/workspacePrefToNpm.test.ts
+++ b/resolving/npm-resolver/test/workspacePrefToNpm.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, test } from '@jest/globals'
+
import { workspacePrefToNpm } from '../lib/workspacePrefToNpm.js'
describe('workspacePrefToNpm', () => {
diff --git a/resolving/registry/pkg-metadata-filter/package.json b/resolving/registry/pkg-metadata-filter/package.json
index 4a8207c831..a99fbea914 100644
--- a/resolving/registry/pkg-metadata-filter/package.json
+++ b/resolving/registry/pkg-metadata-filter/package.json
@@ -40,6 +40,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/resolving.registry.pkg-metadata-filter": "workspace:*",
"@types/semver": "catalog:"
diff --git a/resolving/registry/pkg-metadata-filter/test/index.ts b/resolving/registry/pkg-metadata-filter/test/index.ts
index e7f27eda5d..bb5f9290b3 100644
--- a/resolving/registry/pkg-metadata-filter/test/index.ts
+++ b/resolving/registry/pkg-metadata-filter/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { filterPkgMetadataByPublishDate } from '@pnpm/resolving.registry.pkg-metadata-filter'
test('filterPkgMetadataByPublishDate', () => {
diff --git a/resolving/tarball-resolver/package.json b/resolving/tarball-resolver/package.json
index b332f213e7..e7d404a9fc 100644
--- a/resolving/tarball-resolver/package.json
+++ b/resolving/tarball-resolver/package.json
@@ -36,6 +36,7 @@
"@pnpm/resolving.resolver-base": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/network.fetch": "workspace:*",
"@pnpm/resolving.tarball-resolver": "workspace:*"
},
diff --git a/resolving/tarball-resolver/test/index.ts b/resolving/tarball-resolver/test/index.ts
index cffb241061..3049ac4ae1 100644
--- a/resolving/tarball-resolver/test/index.ts
+++ b/resolving/tarball-resolver/test/index.ts
@@ -1,5 +1,6 @@
///
// cspell:ignore buildserver
+import { expect, test } from '@jest/globals'
import { createFetchFromRegistry } from '@pnpm/network.fetch'
import { resolveFromTarball as _resolveFromTarball } from '@pnpm/resolving.tarball-resolver'
diff --git a/shell/path/package.json b/shell/path/package.json
index 3d8a556ef8..93e8e8eddd 100644
--- a/shell/path/package.json
+++ b/shell/path/package.json
@@ -35,6 +35,7 @@
"path-name": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/shell.path": "workspace:*"
},
"engines": {
diff --git a/shell/path/test/index.ts b/shell/path/test/index.ts
index c4b428bfc3..811bc00794 100644
--- a/shell/path/test/index.ts
+++ b/shell/path/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prependDirsToPath } from '@pnpm/shell.path'
import PATH from 'path-name'
diff --git a/store/cafs/package.json b/store/cafs/package.json
index b6408e6b18..a43c06f8dc 100644
--- a/store/cafs/package.json
+++ b/store/cafs/package.json
@@ -45,6 +45,7 @@
"strip-bom": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/store.cafs": "workspace:*",
"@pnpm/store.cafs-types": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
diff --git a/store/cafs/test/index.ts b/store/cafs/test/index.ts
index 4ced841270..d62da861f5 100644
--- a/store/cafs/test/index.ts
+++ b/store/cafs/test/index.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { describe, expect, it, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import { symlinkDir } from 'symlink-dir'
import { temporaryDirectory } from 'tempy'
diff --git a/store/cafs/test/normalizeBundledManifest.test.ts b/store/cafs/test/normalizeBundledManifest.test.ts
index ee603f2aac..234367e48b 100644
--- a/store/cafs/test/normalizeBundledManifest.test.ts
+++ b/store/cafs/test/normalizeBundledManifest.test.ts
@@ -1,3 +1,5 @@
+import { describe, expect, it } from '@jest/globals'
+
import { normalizeBundledManifest } from '../src/normalizeBundledManifest.js'
describe('normalizeBundledManifest', () => {
diff --git a/store/cafs/test/optimisticRenameOverwrite.test.ts b/store/cafs/test/optimisticRenameOverwrite.test.ts
index 5e6daf5419..ddcafee208 100644
--- a/store/cafs/test/optimisticRenameOverwrite.test.ts
+++ b/store/cafs/test/optimisticRenameOverwrite.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { test } from '@jest/globals'
import { temporaryDirectory } from 'tempy'
import { optimisticRenameOverwrite } from '../src/writeBufferToCafs.js'
diff --git a/store/cafs/test/recursiveSymlink.test.ts b/store/cafs/test/recursiveSymlink.test.ts
index 5a7af175ad..5629b516f3 100644
--- a/store/cafs/test/recursiveSymlink.test.ts
+++ b/store/cafs/test/recursiveSymlink.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { temporaryDirectory } from 'tempy'
import { createCafs } from '../src/index.js'
diff --git a/store/cafs/test/writeBufferToCafs.test.ts b/store/cafs/test/writeBufferToCafs.test.ts
index ca518a5bb5..69ae4a2039 100644
--- a/store/cafs/test/writeBufferToCafs.test.ts
+++ b/store/cafs/test/writeBufferToCafs.test.ts
@@ -4,6 +4,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath, pathToFileURL } from 'node:url'
+import { describe, expect, it } from '@jest/globals'
import { temporaryDirectory } from 'tempy'
import { writeBufferToCafs } from '../src/writeBufferToCafs.js'
diff --git a/store/commands/test/inspecting/catFile.ts b/store/commands/test/inspecting/catFile.ts
index 52271f17a6..0877ab9dd2 100644
--- a/store/commands/test/inspecting/catFile.ts
+++ b/store/commands/test/inspecting/catFile.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import type { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
diff --git a/store/commands/test/inspecting/catIndex.ts b/store/commands/test/inspecting/catIndex.ts
index 3bf614575c..9b80e75de5 100644
--- a/store/commands/test/inspecting/catIndex.ts
+++ b/store/commands/test/inspecting/catIndex.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import type { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
diff --git a/store/commands/test/inspecting/findHash.ts b/store/commands/test/inspecting/findHash.ts
index a53f8705e4..6fe03779f3 100644
--- a/store/commands/test/inspecting/findHash.ts
+++ b/store/commands/test/inspecting/findHash.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { getConfig } from '@pnpm/config.reader'
import type { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
diff --git a/store/commands/test/store/cleanExpiredDlxCache.test.ts b/store/commands/test/store/cleanExpiredDlxCache.test.ts
index 8763c67c86..6706db01b4 100644
--- a/store/commands/test/store/cleanExpiredDlxCache.test.ts
+++ b/store/commands/test/store/cleanExpiredDlxCache.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { beforeEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
const fsOriginal = await import('node:fs')
diff --git a/store/commands/test/store/storeAdd.ts b/store/commands/test/store/storeAdd.ts
index 1259b19046..8f899fd15a 100644
--- a/store/commands/test/store/storeAdd.ts
+++ b/store/commands/test/store/storeAdd.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { assertStore } from '@pnpm/assert-store'
import { STORE_VERSION } from '@pnpm/constants'
import { tempDir } from '@pnpm/prepare'
diff --git a/store/commands/test/store/storePath.ts b/store/commands/test/store/storePath.ts
index 592745c385..a3ff9521c8 100644
--- a/store/commands/test/store/storePath.ts
+++ b/store/commands/test/store/storePath.ts
@@ -1,6 +1,7 @@
import os from 'node:os'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/store/commands/test/store/storePrune.ts b/store/commands/test/store/storePrune.ts
index f5815a6a16..85da17317a 100644
--- a/store/commands/test/store/storePrune.ts
+++ b/store/commands/test/store/storePrune.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { describe, expect, jest, test } from '@jest/globals'
import { assertStore } from '@pnpm/assert-store'
import { STORE_VERSION } from '@pnpm/constants'
import { dlx } from '@pnpm/exec.commands'
diff --git a/store/commands/test/store/storeStatus.ts b/store/commands/test/store/storeStatus.ts
index 7a0be4ba47..9dd3d76efc 100644
--- a/store/commands/test/store/storeStatus.ts
+++ b/store/commands/test/store/storeStatus.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import { prepare } from '@pnpm/prepare'
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
diff --git a/store/controller/package.json b/store/controller/package.json
index 75d4f01061..9cfd989576 100644
--- a/store/controller/package.json
+++ b/store/controller/package.json
@@ -67,6 +67,7 @@
"@pnpm/worker": "workspace:^"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/installing.client": "workspace:*",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",
diff --git a/store/controller/test/index.ts b/store/controller/test/index.ts
index d774e9d096..7e280a8803 100644
--- a/store/controller/test/index.ts
+++ b/store/controller/test/index.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { createClient } from '@pnpm/installing.client'
import { createPackageStore } from '@pnpm/store.controller'
import type { FetchPackageToStoreFunction } from '@pnpm/store.controller-types'
diff --git a/store/controller/test/projectRegistry.ts b/store/controller/test/projectRegistry.ts
index a80669a8aa..5f1599c1c5 100644
--- a/store/controller/test/projectRegistry.ts
+++ b/store/controller/test/projectRegistry.ts
@@ -2,6 +2,7 @@
import { promises as fs } from 'node:fs'
import path from 'node:path'
+import { describe, expect, it } from '@jest/globals'
import { getRegisteredProjects, registerProject } from '@pnpm/store.controller'
import { temporaryDirectory } from 'tempy'
diff --git a/store/index/package.json b/store/index/package.json
index 7ef42bb422..815e9f1101 100644
--- a/store/index/package.json
+++ b/store/index/package.json
@@ -35,6 +35,7 @@
"msgpackr": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/store.index": "workspace:*",
"@types/node": "catalog:",
"tempy": "catalog:"
diff --git a/store/index/test/index.ts b/store/index/test/index.ts
index 5e9f7c7bb9..03ed823c7d 100644
--- a/store/index/test/index.ts
+++ b/store/index/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { StoreIndex, storeIndexKey } from '@pnpm/store.index'
import { temporaryDirectory } from 'tempy'
diff --git a/store/path/test/index.ts b/store/path/test/index.ts
index 3555abf619..d78354a878 100644
--- a/store/path/test/index.ts
+++ b/store/path/test/index.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { expect, jest, test } from '@jest/globals'
import { STORE_VERSION } from '@pnpm/constants'
import isWindows from 'is-windows'
diff --git a/store/pkg-finder/package.json b/store/pkg-finder/package.json
index aedcb055fe..a8390c20e5 100644
--- a/store/pkg-finder/package.json
+++ b/store/pkg-finder/package.json
@@ -38,6 +38,7 @@
"@pnpm/store.index": "workspace:*"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/store.pkg-finder": "workspace:*"
},
"engines": {
diff --git a/store/pkg-finder/test/readPackageFileMap.test.ts b/store/pkg-finder/test/readPackageFileMap.test.ts
index 0743934a98..a6728bb146 100644
--- a/store/pkg-finder/test/readPackageFileMap.test.ts
+++ b/store/pkg-finder/test/readPackageFileMap.test.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import os from 'node:os'
import path from 'node:path'
+import { afterAll, beforeAll, describe, expect, it } from '@jest/globals'
import type { GitResolution, Resolution, TarballResolution } from '@pnpm/resolving.resolver-base'
import type { PackageFilesIndex } from '@pnpm/store.cafs'
import { gitHostedStoreIndexKey, StoreIndex, storeIndexKey } from '@pnpm/store.index'
diff --git a/text/comments-parser/package.json b/text/comments-parser/package.json
index eabf94866b..2caa6bdb45 100644
--- a/text/comments-parser/package.json
+++ b/text/comments-parser/package.json
@@ -35,6 +35,7 @@
"strip-comments-strings": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/text.comments-parser": "workspace:*"
},
"engines": {
diff --git a/text/comments-parser/test/index.ts b/text/comments-parser/test/index.ts
index 0e1b9cc0ee..1d963128fb 100644
--- a/text/comments-parser/test/index.ts
+++ b/text/comments-parser/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { extractComments, insertComments } from '@pnpm/text.comments-parser'
test('extract and insert JSON5 comments', () => {
diff --git a/text/naming-cases/package.json b/text/naming-cases/package.json
index 426aa44dd2..5e3d99ee1c 100644
--- a/text/naming-cases/package.json
+++ b/text/naming-cases/package.json
@@ -32,6 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/text.naming-cases": "workspace:*"
},
"engines": {
diff --git a/text/naming-cases/test/isCamelCase.test.ts b/text/naming-cases/test/isCamelCase.test.ts
index 6a9aa54c74..2c048aae57 100644
--- a/text/naming-cases/test/isCamelCase.test.ts
+++ b/text/naming-cases/test/isCamelCase.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { isCamelCase } from '../src/index.js'
test('camelCase names should satisfy', () => {
diff --git a/text/naming-cases/test/isStrictlyKebabCase.test.ts b/text/naming-cases/test/isStrictlyKebabCase.test.ts
index 68ce36dd19..bbe7e237d1 100644
--- a/text/naming-cases/test/isStrictlyKebabCase.test.ts
+++ b/text/naming-cases/test/isStrictlyKebabCase.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { isStrictlyKebabCase } from '../src/index.js'
test('kebab-case names with more than 1 words should satisfy', () => {
diff --git a/text/tree-renderer/package.json b/text/tree-renderer/package.json
index f3d1d74a64..462dfc96e2 100644
--- a/text/tree-renderer/package.json
+++ b/text/tree-renderer/package.json
@@ -32,6 +32,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/text.tree-renderer": "workspace:*"
},
"engines": {
diff --git a/text/tree-renderer/test/index.ts b/text/tree-renderer/test/index.ts
index e7f9066651..bf4ed71fe5 100644
--- a/text/tree-renderer/test/index.ts
+++ b/text/tree-renderer/test/index.ts
@@ -1,3 +1,4 @@
+import { expect, test } from '@jest/globals'
import { renderTree, type TreeNode, type TreeNodeGroup } from '@pnpm/text.tree-renderer'
test('single root with no children', () => {
diff --git a/worker/package.json b/worker/package.json
index ba2810e132..ce771f1d30 100644
--- a/worker/package.json
+++ b/worker/package.json
@@ -52,6 +52,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/types": "workspace:*",
"@pnpm/worker": "workspace:*",
diff --git a/worker/test/equalOrSemverEqual.test.ts b/worker/test/equalOrSemverEqual.test.ts
index 0ede124bce..1c4987efca 100644
--- a/worker/test/equalOrSemverEqual.test.ts
+++ b/worker/test/equalOrSemverEqual.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { equalOrSemverEqual } from '../lib/equalOrSemverEqual.js'
test('equalOrSemverEqual()', () => {
diff --git a/workspace/commands/package.json b/workspace/commands/package.json
index 765fb11e9a..b219783164 100644
--- a/workspace/commands/package.json
+++ b/workspace/commands/package.json
@@ -44,6 +44,7 @@
"render-help": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/prepare": "workspace:*",
"@pnpm/test-fixtures": "workspace:*",
"@pnpm/workspace.commands": "workspace:*",
diff --git a/workspace/commands/test/init.test.ts b/workspace/commands/test/init.test.ts
index fbe9871ffe..ffc7ff57c6 100644
--- a/workspace/commands/test/init.test.ts
+++ b/workspace/commands/test/init.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepare, prepareEmpty } from '@pnpm/prepare'
import type { ProjectManifest } from '@pnpm/types'
import { init } from '@pnpm/workspace.commands'
diff --git a/workspace/commands/test/utils.test.ts b/workspace/commands/test/utils.test.ts
index 704ab66532..10f37876be 100644
--- a/workspace/commands/test/utils.test.ts
+++ b/workspace/commands/test/utils.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { personToString } from '../lib/utils.js'
test('run the personToString function', () => {
diff --git a/workspace/injected-deps-syncer/test/DirPatcher.test.ts b/workspace/injected-deps-syncer/test/DirPatcher.test.ts
index 0efa617b76..eb146ae7a5 100644
--- a/workspace/injected-deps-syncer/test/DirPatcher.test.ts
+++ b/workspace/injected-deps-syncer/test/DirPatcher.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher'
import { prepareEmpty } from '@pnpm/prepare'
import { lexCompare } from '@pnpm/util.lex-comparator'
diff --git a/workspace/injected-deps-syncer/test/applyPatch.test.ts b/workspace/injected-deps-syncer/test/applyPatch.test.ts
index 571b31cd65..14ee67e02b 100644
--- a/workspace/injected-deps-syncer/test/applyPatch.test.ts
+++ b/workspace/injected-deps-syncer/test/applyPatch.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { fetchFromDir } from '@pnpm/fetching.directory-fetcher'
import { prepareEmpty } from '@pnpm/prepare'
import { lexCompare } from '@pnpm/util.lex-comparator'
diff --git a/workspace/injected-deps-syncer/test/diffDir.test.ts b/workspace/injected-deps-syncer/test/diffDir.test.ts
index 5bb003e4f0..d977aae87c 100644
--- a/workspace/injected-deps-syncer/test/diffDir.test.ts
+++ b/workspace/injected-deps-syncer/test/diffDir.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { diffDir, DIR, type DirDiff, type InodeMap } from '../src/DirPatcher.js'
test('produces a diff', () => {
diff --git a/workspace/injected-deps-syncer/test/extendFilesMap.test.ts b/workspace/injected-deps-syncer/test/extendFilesMap.test.ts
index efcd880ac7..16e85d849c 100644
--- a/workspace/injected-deps-syncer/test/extendFilesMap.test.ts
+++ b/workspace/injected-deps-syncer/test/extendFilesMap.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { DIR, extendFilesMap, type ExtendFilesMapStats, type InodeMap } from '../src/DirPatcher.js'
diff --git a/workspace/project-manifest-reader/package.json b/workspace/project-manifest-reader/package.json
index 6b7f2cadf1..491a2a0226 100644
--- a/workspace/project-manifest-reader/package.json
+++ b/workspace/project-manifest-reader/package.json
@@ -49,6 +49,7 @@
"@pnpm/logger": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/test-fixtures": "workspace:*",
"@pnpm/workspace.project-manifest-reader": "workspace:*",
"@types/is-windows": "catalog:",
diff --git a/workspace/project-manifest-reader/test/index.ts b/workspace/project-manifest-reader/test/index.ts
index dfa2689965..7ef2d7e843 100644
--- a/workspace/project-manifest-reader/test/index.ts
+++ b/workspace/project-manifest-reader/test/index.ts
@@ -2,6 +2,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { fixtures } from '@pnpm/test-fixtures'
import type { ProjectManifest } from '@pnpm/types'
import { readProjectManifest, tryReadProjectManifest } from '@pnpm/workspace.project-manifest-reader'
diff --git a/workspace/project-manifest-writer/package.json b/workspace/project-manifest-writer/package.json
index 6c96a5dd3c..e530b93ea0 100644
--- a/workspace/project-manifest-writer/package.json
+++ b/workspace/project-manifest-writer/package.json
@@ -38,6 +38,7 @@
"write-yaml-file": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.project-manifest-writer": "workspace:*",
"@types/write-file-atomic": "catalog:",
"tempy": "catalog:"
diff --git a/workspace/project-manifest-writer/test/index.ts b/workspace/project-manifest-writer/test/index.ts
index ed52862e52..b7a1446fb6 100644
--- a/workspace/project-manifest-writer/test/index.ts
+++ b/workspace/project-manifest-writer/test/index.ts
@@ -3,6 +3,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { promisify } from 'node:util'
+import { expect, test } from '@jest/globals'
import { writeProjectManifest } from '@pnpm/workspace.project-manifest-writer'
import { temporaryDirectory } from 'tempy'
diff --git a/workspace/projects-filter/package.json b/workspace/projects-filter/package.json
index 4953e05974..6d2ebb3b5b 100644
--- a/workspace/projects-filter/package.json
+++ b/workspace/projects-filter/package.json
@@ -43,6 +43,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/types": "workspace:*",
"@pnpm/workspace.projects-filter": "workspace:*",
"@types/is-windows": "catalog:",
diff --git a/workspace/projects-filter/test/index.ts b/workspace/projects-filter/test/index.ts
index 2b66930e4c..afc8ac3fd7 100644
--- a/workspace/projects-filter/test/index.ts
+++ b/workspace/projects-filter/test/index.ts
@@ -2,6 +2,7 @@ import fs from 'node:fs'
import path from 'node:path'
import { promisify } from 'node:util'
+import { expect, test } from '@jest/globals'
import type { PnpmError } from '@pnpm/error'
import type { ProjectRootDir } from '@pnpm/types'
import { filterWorkspaceProjects, type ProjectGraph } from '@pnpm/workspace.projects-filter'
diff --git a/workspace/projects-filter/test/parseProjectSelector.ts b/workspace/projects-filter/test/parseProjectSelector.ts
index 1bed6eb98e..3a4a680637 100644
--- a/workspace/projects-filter/test/parseProjectSelector.ts
+++ b/workspace/projects-filter/test/parseProjectSelector.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { parseProjectSelector, type ProjectSelector } from '@pnpm/workspace.projects-filter'
import isWindows from 'is-windows'
diff --git a/workspace/projects-graph/package.json b/workspace/projects-graph/package.json
index e5e5b44e7a..3368b3b17d 100644
--- a/workspace/projects-graph/package.json
+++ b/workspace/projects-graph/package.json
@@ -38,6 +38,7 @@
"ramda": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.projects-graph": "workspace:*",
"@types/ramda": "catalog:",
"better-path-resolve": "catalog:"
diff --git a/workspace/projects-graph/test/index.ts b/workspace/projects-graph/test/index.ts
index 07113bfa4a..f4a0c262e6 100644
--- a/workspace/projects-graph/test/index.ts
+++ b/workspace/projects-graph/test/index.ts
@@ -1,4 +1,5 @@
///
+import { expect, test } from '@jest/globals'
import { createProjectsGraph } from '@pnpm/workspace.projects-graph'
import { betterPathResolve as pathResolve } from 'better-path-resolve'
diff --git a/workspace/projects-reader/test/findPackages.ts b/workspace/projects-reader/test/findPackages.ts
index 9a376b33d7..2e6568d40b 100644
--- a/workspace/projects-reader/test/findPackages.ts
+++ b/workspace/projects-reader/test/findPackages.ts
@@ -1,6 +1,7 @@
///
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { findPackages } from '@pnpm/workspace.projects-reader'
function compare (a: string | undefined, b: string | undefined) {
diff --git a/workspace/projects-reader/test/index.ts b/workspace/projects-reader/test/index.ts
index 6ae1275c79..846d350d6d 100644
--- a/workspace/projects-reader/test/index.ts
+++ b/workspace/projects-reader/test/index.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { logger } from '@pnpm/logger'
import {
findWorkspaceProjects,
diff --git a/workspace/range-resolver/package.json b/workspace/range-resolver/package.json
index 748b655601..efc61391a4 100644
--- a/workspace/range-resolver/package.json
+++ b/workspace/range-resolver/package.json
@@ -35,6 +35,7 @@
"semver": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.range-resolver": "workspace:*",
"@types/semver": "catalog:"
},
diff --git a/workspace/range-resolver/test/index.test.ts b/workspace/range-resolver/test/index.test.ts
index 0683704db0..d55731e0b9 100644
--- a/workspace/range-resolver/test/index.test.ts
+++ b/workspace/range-resolver/test/index.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, test } from '@jest/globals'
import { resolveWorkspaceRange } from '@pnpm/workspace.range-resolver'
describe('resolveWorkspaceRange', () => {
diff --git a/workspace/root-finder/package.json b/workspace/root-finder/package.json
index d386781683..1108623563 100644
--- a/workspace/root-finder/package.json
+++ b/workspace/root-finder/package.json
@@ -35,6 +35,7 @@
"find-up": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.root-finder": "workspace:*"
},
"engines": {
diff --git a/workspace/root-finder/test/index.ts b/workspace/root-finder/test/index.ts
index 0761d1cf62..93d00d0f9e 100644
--- a/workspace/root-finder/test/index.ts
+++ b/workspace/root-finder/test/index.ts
@@ -2,11 +2,11 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { findWorkspaceDir } from '@pnpm/workspace.root-finder'
const NPM_CONFIG_WORKSPACE_DIR_ENV_VAR = 'NPM_CONFIG_WORKSPACE_DIR'
const FAKE_PATH = 'FAKE_PATH'
-
function isFileSystemCaseSensitive () {
try {
fs.realpathSync.native(process.cwd().toUpperCase())
diff --git a/workspace/spec-parser/package.json b/workspace/spec-parser/package.json
index 12e045c48f..71604042e3 100644
--- a/workspace/spec-parser/package.json
+++ b/workspace/spec-parser/package.json
@@ -31,6 +31,7 @@
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.spec-parser": "workspace:*"
},
"engines": {
diff --git a/workspace/spec-parser/test/workspace-spec.test.ts b/workspace/spec-parser/test/workspace-spec.test.ts
index 2282ad0abd..16761de4af 100644
--- a/workspace/spec-parser/test/workspace-spec.test.ts
+++ b/workspace/spec-parser/test/workspace-spec.test.ts
@@ -1,3 +1,5 @@
+import { expect, test } from '@jest/globals'
+
import { WorkspaceSpec } from '../src/index.js'
test('parse valid workspace spec', () => {
diff --git a/workspace/state/test/createWorkspaceState.test.ts b/workspace/state/test/createWorkspaceState.test.ts
index d20c4fac0d..50d6e7cf9d 100644
--- a/workspace/state/test/createWorkspaceState.test.ts
+++ b/workspace/state/test/createWorkspaceState.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepareEmpty, preparePackages } from '@pnpm/prepare'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/workspace/state/test/filePath.test.ts b/workspace/state/test/filePath.test.ts
index b11e4e3687..0365b9275b 100644
--- a/workspace/state/test/filePath.test.ts
+++ b/workspace/state/test/filePath.test.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { prepareEmpty } from '@pnpm/prepare'
import { getFilePath } from '../src/filePath.js'
diff --git a/workspace/state/test/loadWorkspaceState.test.ts b/workspace/state/test/loadWorkspaceState.test.ts
index 3595f260ac..c1db7e850b 100644
--- a/workspace/state/test/loadWorkspaceState.test.ts
+++ b/workspace/state/test/loadWorkspaceState.test.ts
@@ -1,7 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, beforeEach, expect, jest, test } from '@jest/globals'
import { logger } from '@pnpm/logger'
import { prepareEmpty } from '@pnpm/prepare'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/workspace/state/test/updatePackagesList.test.ts b/workspace/state/test/updatePackagesList.test.ts
index 68d7799580..61c36636fe 100644
--- a/workspace/state/test/updatePackagesList.test.ts
+++ b/workspace/state/test/updatePackagesList.test.ts
@@ -1,6 +1,6 @@
import path from 'node:path'
-import { jest } from '@jest/globals'
+import { afterEach, expect, jest, test } from '@jest/globals'
import { logger } from '@pnpm/logger'
import { preparePackages } from '@pnpm/prepare'
import type { ProjectRootDir } from '@pnpm/types'
diff --git a/workspace/workspace-manifest-reader/package.json b/workspace/workspace-manifest-reader/package.json
index 6ca1c49b32..9b33694b61 100644
--- a/workspace/workspace-manifest-reader/package.json
+++ b/workspace/workspace-manifest-reader/package.json
@@ -37,6 +37,7 @@
"read-yaml-file": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/workspace.workspace-manifest-reader": "workspace:*"
},
"engines": {
diff --git a/workspace/workspace-manifest-reader/test/index.ts b/workspace/workspace-manifest-reader/test/index.ts
index f572312047..738424eeef 100644
--- a/workspace/workspace-manifest-reader/test/index.ts
+++ b/workspace/workspace-manifest-reader/test/index.ts
@@ -1,5 +1,6 @@
import path from 'node:path'
+import { describe, expect, test } from '@jest/globals'
import { readWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-reader'
test('readWorkspaceManifest() works with a valid workspace file', async () => {
diff --git a/workspace/workspace-manifest-writer/package.json b/workspace/workspace-manifest-writer/package.json
index 708211b6fc..ab5d0dfbaa 100644
--- a/workspace/workspace-manifest-writer/package.json
+++ b/workspace/workspace-manifest-writer/package.json
@@ -44,6 +44,7 @@
"yaml": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/prepare": "workspace:*",
"@pnpm/prepare-temp-dir": "workspace:*",
"@pnpm/workspace.projects-reader": "workspace:*",
diff --git a/workspace/workspace-manifest-writer/test/addCatalogs.test.ts b/workspace/workspace-manifest-writer/test/addCatalogs.test.ts
index efb6910345..539e0d63a5 100644
--- a/workspace/workspace-manifest-writer/test/addCatalogs.test.ts
+++ b/workspace/workspace-manifest-writer/test/addCatalogs.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants'
import { tempDir } from '@pnpm/prepare-temp-dir'
import { updateWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-writer'
diff --git a/workspace/workspace-manifest-writer/test/removeCatalogs.test.ts b/workspace/workspace-manifest-writer/test/removeCatalogs.test.ts
index 7ed093f78c..970e35991b 100644
--- a/workspace/workspace-manifest-writer/test/removeCatalogs.test.ts
+++ b/workspace/workspace-manifest-writer/test/removeCatalogs.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants'
import { prepare } from '@pnpm/prepare'
import { tempDir } from '@pnpm/prepare-temp-dir'
diff --git a/workspace/workspace-manifest-writer/test/updateWorkspaceManifest.test.ts b/workspace/workspace-manifest-writer/test/updateWorkspaceManifest.test.ts
index c7c4d15678..6f92a8cd54 100644
--- a/workspace/workspace-manifest-writer/test/updateWorkspaceManifest.test.ts
+++ b/workspace/workspace-manifest-writer/test/updateWorkspaceManifest.test.ts
@@ -1,6 +1,7 @@
import fs from 'node:fs'
import path from 'node:path'
+import { expect, test } from '@jest/globals'
import { WORKSPACE_MANIFEST_FILENAME } from '@pnpm/constants'
import { tempDir } from '@pnpm/prepare-temp-dir'
import { updateWorkspaceManifest } from '@pnpm/workspace.workspace-manifest-writer'
diff --git a/yaml/document-sync/package.json b/yaml/document-sync/package.json
index 76edebcb62..fcfc124dcc 100644
--- a/yaml/document-sync/package.json
+++ b/yaml/document-sync/package.json
@@ -36,6 +36,7 @@
"yaml": "catalog:"
},
"devDependencies": {
+ "@jest/globals": "catalog:",
"@pnpm/yaml.document-sync": "workspace:*"
},
"engines": {
diff --git a/yaml/document-sync/test/patchDocument.test.ts b/yaml/document-sync/test/patchDocument.test.ts
index 6ab369ddcc..1102a89eb4 100644
--- a/yaml/document-sync/test/patchDocument.test.ts
+++ b/yaml/document-sync/test/patchDocument.test.ts
@@ -1,3 +1,4 @@
+import { describe, expect, it } from '@jest/globals'
import { patchDocument } from '@pnpm/yaml.document-sync'
import yaml from 'yaml'