test: use @jest/globals (#9877)
This commit is contained in:
1 parent
14c78e81d4
commit
c89c93d59b
67 files changed
+315
-33
No files matched your search
@@ -46,6 +46,7 @@
|
||||
"@pnpm/logger": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/exec.build-commands": "workspace:*",
|
||||
"@pnpm/plugin-commands-installation": "workspace:*",
|
||||
"@pnpm/prepare": "workspace:*",
|
||||
|
||||
@@ -9,6 +9,7 @@ import { type ProjectManifest } from '@pnpm/types'
|
||||
import { getConfig } from '@pnpm/config'
|
||||
import { type Modules, readModulesManifest } from '@pnpm/modules-yaml'
|
||||
import { REGISTRY_MOCK_PORT } from '@pnpm/registry-mock'
|
||||
import { jest } from '@jest/globals'
|
||||
import { sync as loadJsonFile } from 'load-json-file'
|
||||
import omit from 'ramda/src/omit'
|
||||
import { tempDir } from '@pnpm/prepare-temp-dir'
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
"@pnpm/logger": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jest/globals": "catalog:",
|
||||
"@pnpm/env.system-node-version": "workspace:*",
|
||||
"@pnpm/filter-workspace-packages": "workspace:*",
|
||||
"@pnpm/logger": "workspace:*",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { PnpmError } from '@pnpm/error'
|
||||
import { jest } from '@jest/globals'
|
||||
import { create, dlx } from '../src'
|
||||
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils'
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ import path from 'path'
|
||||
import execa from 'execa'
|
||||
import { dlx } from '@pnpm/plugin-commands-script-runners'
|
||||
import { prepareEmpty } from '@pnpm/prepare'
|
||||
import { jest } from '@jest/globals'
|
||||
import { DLX_DEFAULT_OPTS as DEFAULT_OPTS } from './utils'
|
||||
|
||||
jest.mock('execa')
|
||||
|
||||
@@ -4,6 +4,7 @@ import { filterPackagesFromDir } from '@pnpm/workspace.filter-packages-from-dir'
|
||||
import { logger } from '@pnpm/logger'
|
||||
import { exec } from '@pnpm/plugin-commands-script-runners'
|
||||
import { preparePackages } from '@pnpm/prepare'
|
||||
import { jest } from '@jest/globals'
|
||||
import writeYamlFile from 'write-yaml-file'
|
||||
import { DEFAULT_OPTS } from './utils'
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import execa from 'execa'
|
||||
import { exec } from '@pnpm/plugin-commands-script-runners'
|
||||
import { prepareEmpty } from '@pnpm/prepare'
|
||||
import { jest } from '@jest/globals'
|
||||
import { DEFAULT_OPTS } from './utils'
|
||||
|
||||
jest.mock('execa')
|
||||
|
||||
@@ -4,11 +4,12 @@ import { globalWarn } from '@pnpm/logger'
|
||||
import { type VerifyDepsBeforeRun } from '@pnpm/config'
|
||||
import { run } from '@pnpm/plugin-commands-script-runners'
|
||||
import { prepare } from '@pnpm/prepare'
|
||||
import { jest } from '@jest/globals'
|
||||
import { prompt } from 'enquirer'
|
||||
import { DEFAULT_OPTS } from './utils'
|
||||
|
||||
jest.mock('@pnpm/logger', () => {
|
||||
const originalModule = jest.requireActual('@pnpm/logger')
|
||||
const originalModule = jest.requireActual<object>('@pnpm/logger')
|
||||
return {
|
||||
...originalModule,
|
||||
globalWarn: jest.fn(),
|
||||
|
||||
Reference in new issue
Block a user