mirror of
https://github.com/pnpm/pnpm.git
synced 2026-05-11 17:42:43 -04:00
chore: upgrade @typescript/native-preview to 7.0.0-dev.20260421.2 (#11332)
* chore: upgrade @typescript/native-preview to 7.0.0-dev.20260421.2
- Add explicit `types: ["node"]` to the shared tsconfig because tsgo
20260421 no longer auto-acquires `@types/*` from `node_modules`.
- Refactor test files to explicitly import jest globals (`describe`,
`it`, `test`, `expect`, `beforeEach`, etc.) from `@jest/globals`
instead of relying on `@types/jest` ambient declarations. Under the
new tsgo build, `import { jest } from '@jest/globals'` shadows the
ambient `jest` namespace, breaking `@types/jest`'s `declare var
describe: jest.Describe;` globals.
- Add `@jest/globals` to each package's devDependencies where tests
now import from it, and add `@types/node` to packages that need it
but were relying on hoisted resolution.
- Replace `fail()` calls with `throw new Error(...)` since `fail` is
no longer globally available.
* chore: fix remaining tsgo type-strictness errors
- Strip `as <PnpmType>` casts on objects passed to toMatchObject /
toStrictEqual / toEqual; @jest/globals rejects the typed objects
(which include AsymmetricMatchers) vs. the repo-specific type.
- Type `jest.fn<...>()` explicitly where the mock's signature matters
for toHaveBeenCalledWith.
- Replace `beforeEach(() => X)` with `beforeEach(() => { X })` so the
return value is void, as the stricter jest typing requires.
- Use `expect.objectContaining({...})` in one place where the full
expected object triggered stricter type resolution.
- Cast `prompt.mock.calls` arg through `as unknown as Record<...>[]`
for patch.test.ts's nested-array matchers.
- Fix off-by-one `<reference path>` in pnpm/test/getConfig.test.ts
that only surfaced now.
- Move `@jest/globals` from devDependencies to dependencies in the
two `__utils__` packages that import it from `src/`.
- Clean up unused imports from the @jest/globals migration.
* chore: address Copilot review on #11332
- Move misplaced `@jest/globals` imports to the top import block in
checkEngine, run.ts, and workspace/root-finder tests where the
script dropped them below executable code.
- Replace `try { await x(); throw new Error('should have thrown') } catch`
in bins/linker, lockfile/fs, and resolving/local-resolver tests with
`await expect(x()).rejects.toMatchObject({...})`. The old pattern
swallowed an unrelated `throw` if the under-test call silently
succeeded, which would fail on the catch-block assertion with a
misleading message.
This commit is contained in:
@@ -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:*",
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
/// <reference path="../../../__typings__/index.d.ts"/>
|
||||
import path from 'node:path'
|
||||
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import { assertProject } from '../src/index.js'
|
||||
|
||||
test('assertProject()', async () => {
|
||||
|
||||
@@ -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:"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/// <reference path="../../../__typings__/index.d.ts"/>
|
||||
import path from 'node:path'
|
||||
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { assertStore } from '@pnpm/assert-store'
|
||||
import { STORE_VERSION } from '@pnpm/constants'
|
||||
|
||||
|
||||
@@ -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:",
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"sourceMap": true,
|
||||
"strict": true,
|
||||
"target": "es2022",
|
||||
"types": ["node"],
|
||||
"verbatimModuleSyntax": true
|
||||
},
|
||||
"atom": {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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<LogoutContext['fetch']>(async () => createMockResponse({ ok: true, status: 200 }))
|
||||
let savedPath = ''
|
||||
let savedSettings: Record<string, unknown> = {}
|
||||
|
||||
@@ -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<LogoutContext['fetch']>(async () => createMockResponse({ ok: true, status: 200 }))
|
||||
let savedSettings: Record<string, unknown> = {}
|
||||
|
||||
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<LogoutContext['fetch']>(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<LogoutContext['fetch']>(async () => createMockResponse({ ok: true, status: 200 }))
|
||||
let savedSettings: Record<string, unknown> = {}
|
||||
|
||||
const context = createMockContext({
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
"tinyglobby": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/bins.resolver": "workspace:*",
|
||||
"@types/node": "catalog:",
|
||||
"tempy": "catalog:"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import path from 'node:path'
|
||||
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { getBinsFromPackageManifest } from '@pnpm/bins.resolver'
|
||||
|
||||
test('getBinsFromPackageManifest()', async () => {
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
"@pnpm/worker": "workspace:^"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/building.during-install": "workspace:*",
|
||||
"@pnpm/logger": "workspace:*",
|
||||
"@types/ramda": "catalog:"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import { buildSequence } from '../lib/buildSequence.js'
|
||||
|
||||
test('buildSequence() test 1', () => {
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"@pnpm/types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/building.policy": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, it } from '@jest/globals'
|
||||
import { createAllowBuildFunction } from '@pnpm/building.policy'
|
||||
|
||||
it('should allowBuilds with true value', () => {
|
||||
|
||||
1
cache/commands/package.json
vendored
1
cache/commands/package.json
vendored
@@ -45,6 +45,7 @@
|
||||
"@pnpm/logger": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/cache.commands": "workspace:*",
|
||||
"@pnpm/logger": "workspace:*",
|
||||
"@pnpm/prepare": "workspace:*",
|
||||
|
||||
1
cache/commands/test/cacheDelete.cmd.test.ts
vendored
1
cache/commands/test/cacheDelete.cmd.test.ts
vendored
@@ -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'
|
||||
|
||||
1
cache/commands/test/cacheList.cmd.test.ts
vendored
1
cache/commands/test/cacheList.cmd.test.ts
vendored
@@ -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'
|
||||
|
||||
1
cache/commands/test/cacheView.cmd.test.ts
vendored
1
cache/commands/test/cacheView.cmd.test.ts
vendored
@@ -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'
|
||||
|
||||
@@ -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:*"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { getCatalogsFromWorkspaceManifest } from '@pnpm/catalogs.config'
|
||||
|
||||
test('combines implicit default and named catalogs', () => {
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from '@jest/globals'
|
||||
import { parseCatalogProtocol } from '@pnpm/catalogs.protocol-parser'
|
||||
|
||||
test('parses named catalog', () => {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import { complete } from '../../src/completion/complete.js'
|
||||
|
||||
test('complete an option value', async () => {
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import {
|
||||
currentTypedWordType,
|
||||
getLastOption,
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import { getShellFromParams, getShellFromString } from '../../src/completion/getShell.js'
|
||||
|
||||
test('getShellFromString errors on undefined', () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import { optionTypesToCompletions } from '../../src/completion/optionTypesToCompletions.js'
|
||||
|
||||
test('optionTypesToCompletions', () => {
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
"@pnpm/logger": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/cli.default-reporter": "workspace:*",
|
||||
"@pnpm/logger": "workspace:*",
|
||||
"@types/normalize-path": "catalog:",
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/// <reference path="../../../__typings__/index.d.ts"/>
|
||||
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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { toOutput$ } from '@pnpm/cli.default-reporter'
|
||||
import { peerDependencyIssuesLogger } from '@pnpm/core-loggers'
|
||||
import {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { toOutput$ } from '@pnpm/cli.default-reporter'
|
||||
import { requestRetryLogger } from '@pnpm/core-loggers'
|
||||
import {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"load-json-file": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/cli.meta": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from '@jest/globals'
|
||||
import { detectIfCurrentPkgIsExecutable, getCurrentPackageName, isExecutedByCorepack } from '@pnpm/cli.meta'
|
||||
|
||||
describe('detectIfCurrentPkgIsExecutable()', () => {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
"didyoumean2": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/cli.parse-cli-args": "workspace:*",
|
||||
"tempy": "catalog:"
|
||||
},
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, test } from '@jest/globals'
|
||||
import { config } from '@pnpm/config.commands'
|
||||
|
||||
import { createConfigCommandOpts, getOutputString } from './utils/index.js'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { config } from '@pnpm/config.commands'
|
||||
|
||||
import { createConfigCommandOpts, getOutputString } from './utils/index.js'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"escape-string-regexp": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/config.matcher": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { createMatcher, createMatcherWithIndex } from '@pnpm/config.matcher'
|
||||
|
||||
test('matcher()', () => {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"@pnpm/resolving.parse-wanted-dependency": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/config.parse-overrides": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { parseOverrides } from '@pnpm/config.parse-overrides'
|
||||
|
||||
test.each([
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
"@pnpm/types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/config.pick-registry-for-package": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { pickRegistryForPackage } from '@pnpm/config.pick-registry-for-package'
|
||||
|
||||
test('pick correct scope', () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
|
||||
import type { InheritableConfigPair } from './inheritPickedConfig.js'
|
||||
import { inheritAuthConfig, inheritDlxConfig } from './localConfig.js'
|
||||
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -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()', () => {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { afterEach, expect, test } from '@jest/globals'
|
||||
|
||||
import { getOptionsFromPnpmSettings } from '../lib/getOptionsFromRootManifest.js'
|
||||
|
||||
const ORIGINAL_ENV = process.env
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { describe, expect, test } from '@jest/globals'
|
||||
|
||||
import {
|
||||
AuthMissingSeparatorError,
|
||||
type Creds,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from '@jest/globals'
|
||||
import { omit } from 'ramda'
|
||||
|
||||
import type {
|
||||
|
||||
@@ -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'
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"semver": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/config.version-policy": "workspace:*",
|
||||
"@types/semver": "catalog:"
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { createPackageVersionPolicy } from '@pnpm/config.version-policy'
|
||||
|
||||
test('createPackageVersionPolicy()', () => {
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"@pnpm/constants": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/error": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { FetchError, PnpmError } from '@pnpm/error'
|
||||
|
||||
test('PnpmError exposes cause when provided', () => {
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"split2": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/logger": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { expect, test } from '@jest/globals'
|
||||
import { type LogBase, logger, streamParser } from '@pnpm/logger'
|
||||
|
||||
test('logger logs', async () => {
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"ssri": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/crypto.hash": "workspace:*",
|
||||
"@pnpm/prepare": "workspace:*",
|
||||
"@types/ssri": "catalog:",
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"@pnpm/error": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/crypto.integrity": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from '@jest/globals'
|
||||
import { formatIntegrity, parseIntegrity } from '@pnpm/crypto.integrity'
|
||||
|
||||
describe('parseIntegrity', () => {
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
"ramda": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/crypto.object-hasher": "workspace:*",
|
||||
"@types/object-hash": "catalog:",
|
||||
"@types/ramda": "catalog:"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from '@jest/globals'
|
||||
import { hashObject, hashObjectNullableWithPrefix, hashObjectWithoutSorting } from '@pnpm/crypto.object-hasher'
|
||||
|
||||
describe('hashObject', () => {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
"@pnpm/fetching.types": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/crypto.shasums-file": "workspace:*"
|
||||
},
|
||||
"engines": {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { describe, expect, it } from '@jest/globals'
|
||||
import { pickFileChecksumFromShasumsFile } from '@pnpm/crypto.shasums-file'
|
||||
|
||||
describe('pickFileChecksumFromShasumsFile', () => {
|
||||
|
||||
1
deps/compliance/audit/package.json
vendored
1
deps/compliance/audit/package.json
vendored
@@ -48,6 +48,7 @@
|
||||
"@pnpm/logger": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/constants": "workspace:*",
|
||||
"@pnpm/deps.compliance.audit": "workspace:*",
|
||||
"@pnpm/logger": "workspace:*",
|
||||
|
||||
1
deps/compliance/audit/test/index.ts
vendored
1
deps/compliance/audit/test/index.ts
vendored
@@ -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'
|
||||
|
||||
1
deps/compliance/commands/test/audit/fix.ts
vendored
1
deps/compliance/commands/test/audit/fix.ts
vendored
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
@@ -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'
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user