From 582f77371c28ce5cf733246a8a69da75c8f9e302 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 12 Sep 2022 16:58:52 +0200 Subject: [PATCH] chore(deps): update jest monorepo (#17737) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Michael Kriese --- lib/modules/datasource/aws-rds/index.spec.ts | 4 +- lib/modules/datasource/docker/index.spec.ts | 89 ++++----- .../manager/git-submodules/extract.spec.ts | 9 +- lib/modules/manager/gradle/extract.spec.ts | 3 +- lib/modules/manager/gradle/parser.spec.ts | 3 +- .../manager/npm/post-update/index.spec.ts | 3 +- lib/modules/manager/nuget/artifacts.spec.ts | 5 +- lib/util/exec/common.spec.ts | 3 +- lib/util/exec/index.spec.ts | 2 +- .../repository/dependency-dashboard.spec.ts | 12 +- lib/workers/repository/stats.spec.ts | 3 +- .../repository/update/branch/commit.spec.ts | 13 +- .../repository/update/branch/index.spec.ts | 3 +- .../repository/update/pr/code-owners.spec.ts | 7 +- package.json | 9 +- test/fixtures.ts | 15 +- test/setup.ts | 159 +++++++++++++++ test/util.ts | 17 +- test/website-docs.spec.ts | 6 +- tsconfig.json | 2 +- yarn.lock | 187 +++++------------- 21 files changed, 318 insertions(+), 236 deletions(-) diff --git a/lib/modules/datasource/aws-rds/index.spec.ts b/lib/modules/datasource/aws-rds/index.spec.ts index 8a5015e689d09d..fa94db92adcfe6 100644 --- a/lib/modules/datasource/aws-rds/index.spec.ts +++ b/lib/modules/datasource/aws-rds/index.spec.ts @@ -94,7 +94,9 @@ function mockDescribeVersionsCommand( } describe('modules/datasource/aws-rds/index', () => { - beforeEach(() => rdsMock.reset()); + beforeEach(() => { + rdsMock.reset(); + }); describe('getPkgReleases()', () => { it('without returned versions', async () => { diff --git a/lib/modules/datasource/docker/index.spec.ts b/lib/modules/datasource/docker/index.spec.ts index 10a417c0c215e7..6406f6ceddedb7 100644 --- a/lib/modules/datasource/docker/index.spec.ts +++ b/lib/modules/datasource/docker/index.spec.ts @@ -1,7 +1,12 @@ -import * as _AWS from '@aws-sdk/client-ecr'; +import { + ECRClient, + GetAuthorizationTokenCommand, + GetAuthorizationTokenCommandOutput, +} from '@aws-sdk/client-ecr'; +import { mockClient } from 'aws-sdk-client-mock'; import { getDigest, getPkgReleases } from '..'; import * as httpMock from '../../../../test/http-mock'; -import { logger, mocked, partial } from '../../../../test/util'; +import { logger, mocked } from '../../../../test/util'; import { EXTERNAL_HOST_ERROR, PAGE_NOT_FOUND_ERROR, @@ -15,13 +20,9 @@ const hostRules = mocked(_hostRules); const http = new Http(DockerDatasource.id); -jest.mock('@aws-sdk/client-ecr'); jest.mock('../../../util/host-rules'); -type ECR = _AWS.ECR; -type GetAuthorizationTokenCommandOutput = - _AWS.GetAuthorizationTokenCommandOutput; -const AWS = mocked(_AWS); +const ecrMock = mockClient(ECRClient); const baseUrl = 'https://index.docker.io/v2'; const authUrl = 'https://auth.docker.io'; @@ -30,26 +31,16 @@ const amazonUrl = 'https://123456789.dkr.ecr.us-east-1.amazonaws.com/v2'; function mockEcrAuthResolve( res: Partial = {} ) { - AWS.ECR.mockImplementationOnce(() => - partial({ - getAuthorizationToken: () => - Promise.resolve( - partial(res) - ), - }) - ); + ecrMock.on(GetAuthorizationTokenCommand).resolvesOnce(res); } function mockEcrAuthReject(msg: string) { - AWS.ECR.mockImplementationOnce(() => - partial({ - getAuthorizationToken: jest.fn().mockRejectedValue(new Error(msg)), - }) - ); + ecrMock.on(GetAuthorizationTokenCommand).rejectsOnce(new Error(msg)); } describe('modules/datasource/docker/index', () => { beforeEach(() => { + ecrMock.reset(); hostRules.find.mockReturnValue({ username: 'some-username', password: 'some-password', @@ -415,20 +406,21 @@ describe('modules/datasource/docker/index', () => { authorizationData: [{ authorizationToken: 'test_token' }], }); - await getDigest( - { - datasource: 'docker', - depName: '123456789.dkr.ecr.us-east-1.amazonaws.com/node', - }, - 'some-tag' - ); + expect( + await getDigest( + { + datasource: 'docker', + depName: '123456789.dkr.ecr.us-east-1.amazonaws.com/node', + }, + 'some-tag' + ) + ).toBe('some-digest'); - expect(AWS.ECR).toHaveBeenCalledWith({ - credentials: { - accessKeyId: 'some-username', - secretAccessKey: 'some-password', - }, - region: 'us-east-1', + const ecr = ecrMock.call(0).thisValue as ECRClient; + expect(await ecr.config.region()).toBe('us-east-1'); + expect(await ecr.config.credentials()).toEqual({ + accessKeyId: 'some-username', + secretAccessKey: 'some-password', }); }); @@ -453,21 +445,22 @@ describe('modules/datasource/docker/index', () => { authorizationData: [{ authorizationToken: 'test_token' }], }); - await getDigest( - { - datasource: 'docker', - depName: '123456789.dkr.ecr.us-east-1.amazonaws.com/node', - }, - 'some-tag' - ); - - expect(AWS.ECR).toHaveBeenCalledWith({ - credentials: { - accessKeyId: 'some-username', - secretAccessKey: 'some-password', - sessionToken: 'some-session-token', - }, - region: 'us-east-1', + expect( + await getDigest( + { + datasource: 'docker', + depName: '123456789.dkr.ecr.us-east-1.amazonaws.com/node', + }, + 'some-tag' + ) + ).toBe('some-digest'); + + const ecr = ecrMock.call(0).thisValue as ECRClient; + expect(await ecr.config.region()).toBe('us-east-1'); + expect(await ecr.config.credentials()).toEqual({ + accessKeyId: 'some-username', + secretAccessKey: 'some-password', + sessionToken: 'some-session-token', }); }); diff --git a/lib/modules/manager/git-submodules/extract.spec.ts b/lib/modules/manager/git-submodules/extract.spec.ts index 020c86bee4c623..aaf74a15c22124 100644 --- a/lib/modules/manager/git-submodules/extract.spec.ts +++ b/lib/modules/manager/git-submodules/extract.spec.ts @@ -1,6 +1,11 @@ import is from '@sindresorhus/is'; import { mock } from 'jest-mock-extended'; -import _simpleGit, { Response, SimpleGit, TaskOptions } from 'simple-git'; +import _simpleGit, { + Response, + SimpleGit, + SimpleGitFactory, + TaskOptions, +} from 'simple-git'; import { GlobalConfig } from '../../../config/global'; import * as hostRules from '../../../util/host-rules'; import type { PackageFile } from '../types'; @@ -8,7 +13,7 @@ import { extractPackageFile } from '.'; jest.mock('simple-git'); const simpleGit: jest.Mock> = _simpleGit as never; -const Git: typeof _simpleGit = jest.requireActual('simple-git'); +const Git = jest.requireActual('simple-git') as SimpleGitFactory; describe('modules/manager/git-submodules/extract', () => { // flaky ci tests diff --git a/lib/modules/manager/gradle/extract.spec.ts b/lib/modules/manager/gradle/extract.spec.ts index 9f40e3930036c7..00ffd70da40fe2 100644 --- a/lib/modules/manager/gradle/extract.spec.ts +++ b/lib/modules/manager/gradle/extract.spec.ts @@ -7,7 +7,8 @@ import { extractAllPackageFiles } from '.'; jest.mock('../../../util/fs'); function mockFs(files: Record): void { - fs.readLocalFile.mockImplementation((fileName: string): Promise => { + // TODO: fix types, jest is using wrong overload (#7154) + fs.readLocalFile.mockImplementation((fileName: string): Promise => { const content = files?.[fileName]; return Promise.resolve(content ?? ''); }); diff --git a/lib/modules/manager/gradle/parser.spec.ts b/lib/modules/manager/gradle/parser.spec.ts index 123d6e001bddfa..d6b4feec6deeea 100644 --- a/lib/modules/manager/gradle/parser.spec.ts +++ b/lib/modules/manager/gradle/parser.spec.ts @@ -19,7 +19,8 @@ function mockFs(files: Record): void { } ); - fs.readLocalFile.mockImplementation((fileName: string): Promise => { + // TODO: fix types, jest is using wrong overload (#7154) + fs.readLocalFile.mockImplementation((fileName: string): Promise => { const content = files?.[fileName]; return Promise.resolve(content ?? ''); }); diff --git a/lib/modules/manager/npm/post-update/index.spec.ts b/lib/modules/manager/npm/post-update/index.spec.ts index 4ac567e6e34101..549e387449cb27 100644 --- a/lib/modules/manager/npm/post-update/index.spec.ts +++ b/lib/modules/manager/npm/post-update/index.spec.ts @@ -370,7 +370,8 @@ describe('modules/manager/npm/post-update/index', () => { it('works for npm', async () => { spyNpm.mockResolvedValueOnce({ error: false, lockFile: '{}' }); - fs.readLocalFile.mockImplementation((f) => { + // TODO: fix types, jest is using wrong overload (#7154) + fs.readLocalFile.mockImplementation((f): Promise => { if (f === '.npmrc') { return Promise.resolve('# dummy'); } diff --git a/lib/modules/manager/nuget/artifacts.spec.ts b/lib/modules/manager/nuget/artifacts.spec.ts index c07b622fa4ee6c..7faf362b883a1d 100644 --- a/lib/modules/manager/nuget/artifacts.spec.ts +++ b/lib/modules/manager/nuget/artifacts.spec.ts @@ -18,8 +18,9 @@ jest.mock('./util'); const { getConfiguredRegistries, getDefaultRegistries } = mocked(util); const hostRules = mocked(_hostRules); -const realFs: typeof import('../../../util/fs') = - jest.requireActual('../../../util/fs'); +const realFs = jest.requireActual( + '../../../util/fs' +) as typeof import('../../../util/fs'); const adminConfig: RepoGlobalConfig = { // `join` fixes Windows CI diff --git a/lib/util/exec/common.spec.ts b/lib/util/exec/common.spec.ts index f27c0870568cbd..1a1c6d9bf2571d 100644 --- a/lib/util/exec/common.spec.ts +++ b/lib/util/exec/common.spec.ts @@ -57,7 +57,8 @@ function getReadable( return readable; } -function getSpawnStub(args: StubArgs): ChildProcess { +// TODO: fix types, jest is using wrong overload (#7154) +function getSpawnStub(args: StubArgs): any { const { cmd, error, diff --git a/lib/util/exec/index.spec.ts b/lib/util/exec/index.spec.ts index 463e690390dcc4..11370a1c93a8f9 100644 --- a/lib/util/exec/index.spec.ts +++ b/lib/util/exec/index.spec.ts @@ -11,7 +11,7 @@ import { exec } from '.'; const getHermitEnvsMock = mockedFunction(getHermitEnvs); jest.mock('./hermit', () => ({ - ...jest.requireActual('./hermit'), + ...(jest.requireActual('./hermit') as any), getHermitEnvs: jest.fn(), })); jest.mock('../../modules/datasource'); diff --git a/lib/workers/repository/dependency-dashboard.spec.ts b/lib/workers/repository/dependency-dashboard.spec.ts index 712f4a3659520e..66786f92e6e2e3 100644 --- a/lib/workers/repository/dependency-dashboard.spec.ts +++ b/lib/workers/repository/dependency-dashboard.spec.ts @@ -26,7 +26,9 @@ import { PackageFiles } from './package-files'; type PrUpgrade = BranchUpgradeConfig; -const massageMdSpy = jest.spyOn(platform, 'massageMarkdown'); +const massageMdSpy = platform.massageMarkdown; +const getIssueSpy = platform.getIssue; + let config: RenovateConfig; beforeEach(() => { @@ -64,7 +66,7 @@ function genRandPackageFile( async function dryRun( branches: BranchConfig[], - platform: jest.Mocked, + platform: jest.MockedObject, ensureIssueClosingCalls = 0, ensureIssueCalls = 0 ) { @@ -605,7 +607,7 @@ describe('workers/repository/dependency-dashboard', () => { branchName2: 'approve-branch', }; config.dependencyDashboardIssue = 1; - jest.spyOn(platform, 'getIssue').mockResolvedValueOnce({ + getIssueSpy.mockResolvedValueOnce({ title: 'Dependency Dashboard', body: `This issue contains a list of Renovate updates and their statuses. @@ -667,7 +669,7 @@ describe('workers/repository/dependency-dashboard', () => { branchName2: 'unlimit-branch', }; config.dependencyDashboardIssue = 1; - jest.spyOn(platform, 'getIssue').mockResolvedValueOnce({ + getIssueSpy.mockResolvedValueOnce({ title: 'Dependency Dashboard', body: `This issue contains a list of Renovate updates and their statuses. ## Rate-limited @@ -726,7 +728,7 @@ describe('workers/repository/dependency-dashboard', () => { config.dependencyDashboard = true; config.dependencyDashboardChecks = { branchName2: 'approve-branch' }; config.dependencyDashboardIssue = 1; - mockedFunction(platform.getIssue!).mockResolvedValueOnce({ + mockedFunction(platform.getIssue).mockResolvedValueOnce({ title: 'Dependency Dashboard', body: `This issue contains a list of Renovate updates and their statuses. diff --git a/lib/workers/repository/stats.spec.ts b/lib/workers/repository/stats.spec.ts index a43ced7d61ccba..c8f0908a854879 100644 --- a/lib/workers/repository/stats.spec.ts +++ b/lib/workers/repository/stats.spec.ts @@ -56,7 +56,8 @@ describe('workers/repository/stats', () => { statusCode: 401, }, ]; - memCache.get.mockImplementationOnce(() => stats); + // TODO: fix types, jest is using wrong overload (#7154) + memCache.get.mockImplementationOnce(() => stats as any); expect(printRequestStats()).toBeUndefined(); expect(log.trace).toHaveBeenCalledOnce(); expect(log.debug).toHaveBeenCalledTimes(2); diff --git a/lib/workers/repository/update/branch/commit.spec.ts b/lib/workers/repository/update/branch/commit.spec.ts index aa79c7b50d5283..525995e7d8cc86 100644 --- a/lib/workers/repository/update/branch/commit.spec.ts +++ b/lib/workers/repository/update/branch/commit.spec.ts @@ -1,9 +1,4 @@ -import { - getConfig, - git, - mockedFunction, - platform, -} from '../../../../../test/util'; +import { getConfig, git, platform } from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; import type { BranchConfig } from '../../../types'; import { commitFilesToBranch } from './commit'; @@ -29,7 +24,6 @@ describe('workers/repository/update/branch/commit', () => { } as BranchConfig; jest.resetAllMocks(); git.commitFiles.mockResolvedValueOnce('123test'); - platform.commitFiles = jest.fn(); GlobalConfig.reset(); }); @@ -58,10 +52,7 @@ describe('workers/repository/update/branch/commit', () => { config.platformCommit = true; await commitFilesToBranch(config); expect(platform.commitFiles).toHaveBeenCalledTimes(1); - // TODO #7154 - expect( - mockedFunction(platform.commitFiles!).mock.calls - ).toMatchSnapshot(); + expect(platform.commitFiles.mock.calls).toMatchSnapshot(); }); it('dry runs', async () => { diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts index 4da4fa0c7ddd90..f1f224d813fb3e 100644 --- a/lib/workers/repository/update/branch/index.spec.ts +++ b/lib/workers/repository/update/branch/index.spec.ts @@ -122,7 +122,8 @@ describe('workers/repository/update/branch/index', () => { }), }); GlobalConfig.set(adminConfig); - sanitize.sanitize.mockImplementation((input) => input); + // TODO: fix types, jest is using wrong overload (#7154) + sanitize.sanitize.mockImplementation((input) => input!); repoCache.getCache.mockReturnValue({}); }); diff --git a/lib/workers/repository/update/pr/code-owners.spec.ts b/lib/workers/repository/update/pr/code-owners.spec.ts index f3639b9ed15d06..3fa999750ae968 100644 --- a/lib/workers/repository/update/pr/code-owners.spec.ts +++ b/lib/workers/repository/update/pr/code-owners.spec.ts @@ -63,9 +63,7 @@ describe('workers/repository/update/pr/code-owners', () => { }); it('returns empty array when error occurs', async () => { - fs.readLocalFile.mockImplementationOnce((_, __) => { - throw new Error(); - }); + fs.readLocalFile.mockRejectedValueOnce(new Error()); const codeOwners = await codeOwnersForPr(pr); expect(codeOwners).toBeEmptyArray(); }); @@ -78,7 +76,8 @@ describe('workers/repository/update/pr/code-owners', () => { ]; codeOwnerFilePaths.forEach((codeOwnerFilePath) => { it(`detects code owner file at '${codeOwnerFilePath}'`, async () => { - fs.readLocalFile.mockImplementation((path, _) => { + // TODO: fix types, jest is using wrong overload (#7154) + fs.readLocalFile.mockImplementation((path): Promise => { if (path === codeOwnerFilePath) { return Promise.resolve(['* @mike'].join('\n')); } diff --git a/package.json b/package.json index 784d521810540d..c78b85a084462f 100644 --- a/package.json +++ b/package.json @@ -226,9 +226,9 @@ }, "devDependencies": { "@actions/core": "1.9.1", - "@jest/globals": "29.0.1", - "@jest/reporters": "29.0.1", - "@jest/test-result": "29.0.1", + "@jest/globals": "29.0.2", + "@jest/reporters": "29.0.2", + "@jest/test-result": "29.0.2", "@ls-lint/ls-lint": "1.11.2", "@openpgp/web-stream-tools": "0.0.11", "@renovate/eslint-plugin": "https://github.com/renovatebot/eslint-plugin#v0.0.4", @@ -247,7 +247,6 @@ "@types/github-url-from-git": "1.5.1", "@types/global-agent": "2.1.1", "@types/ini": "1.3.31", - "@types/jest": "28.1.7", "@types/js-yaml": "4.0.5", "@types/json-dup-key-validator": "1.0.0", "@types/linkify-markdown": "1.0.1", @@ -289,7 +288,7 @@ "glob": "8.0.3", "graphql": "16.6.0", "husky": "8.0.1", - "jest": "29.0.1", + "jest": "29.0.2", "jest-extended": "3.1.0", "jest-junit": "14.0.1", "jest-mock-extended": "2.0.6", diff --git a/test/fixtures.ts b/test/fixtures.ts index 4a371176db72cc..f6b0877c8ae210 100644 --- a/test/fixtures.ts +++ b/test/fixtures.ts @@ -1,10 +1,11 @@ import type fs from 'fs'; import type { PathLike, Stats } from 'fs'; +import { jest } from '@jest/globals'; import callsite from 'callsite'; import { DirectoryJSON, fs as memfs, vol } from 'memfs'; import upath from 'upath'; -const realFs = jest.requireActual('fs'); +const realFs = jest.requireActual('fs') as typeof fs; /** * Class to work with in-memory file-system @@ -89,12 +90,12 @@ export class Fixtures { static fsExtra(): any { return { ...memfs, - pathExists: jest.fn().mockImplementation(pathExists), - remove: jest.fn().mockImplementation(memfs.promises.rm), - readFile: jest.fn().mockImplementation(memfs.promises.readFile), - writeFile: jest.fn().mockImplementation(memfs.promises.writeFile), - outputFile: jest.fn().mockImplementation(outputFile), - stat: jest.fn().mockImplementation(stat), + pathExists: jest.fn(pathExists), + remove: jest.fn(memfs.promises.rm), + readFile: jest.fn(memfs.promises.readFile), + writeFile: jest.fn(memfs.promises.writeFile), + outputFile: jest.fn(outputFile), + stat: jest.fn(stat), }; } diff --git a/test/setup.ts b/test/setup.ts index b77578c353b41a..7a4b2a9fdeb003 100644 --- a/test/setup.ts +++ b/test/setup.ts @@ -1,5 +1,20 @@ +import type { Jest } from '@jest/environment'; // Check for missing or pending http mocks import './http-mock'; +import type { Global } from '@jest/types'; +import type { AsymmetricMatchers, BaseExpect, Matchers } from 'expect'; +import type { + ClassLike, + FunctionLike, + MockInstance as JestMockInstance, + Mocked as JestMocked, + MockedClass as JestMockedClass, + MockedFunction as JestMockedFunction, + MockedObject as JestMockedObject, + SpyInstance as JestSpyInstance, +} from 'jest-mock'; +import type { SnapshotMatchers } from 'jest-snapshot'; +import type { Plugin } from 'pretty-format'; jest.mock('../lib/modules/platform', () => ({ platform: jest.createMockFromModule('../lib/modules/platform/github'), @@ -7,3 +22,147 @@ jest.mock('../lib/modules/platform', () => ({ getPlatformList: jest.fn(), })); jest.mock('../lib/logger'); + +//------------------------------------------------ +// Required global jest types +//------------------------------------------------ +declare global { + // Extension point for jest matchers + type JestMatchers = jest.Matchers & + SnapshotMatchers ? R : void, T> & + Omit< + Matchers ? R : void>, + 'toMatchObject' + > & { + // TODO: override, because type issues (#7154) + /** + * Used to check that a JavaScript object matches a subset of the properties of an object + * + * Optionally, you can provide an object to use as Generic type for the expected value. + * This ensures that the matching object matches the structure of the provided object-like type. + * + * @example + * + * type House = { + * bath: boolean; + * bedrooms: number; + * kitchen: { + * amenities: string[]; + * area: number; + * wallColor: string; + * } + * }; + * + * expect(desiredHouse).toMatchObject({...standardHouse, kitchen: {area: 20}}) // wherein standardHouse is some base object of type House + */ + toMatchObject( + expected: E + ): R extends void | Promise ? R : void; + }; +} + +type JestInverse = { + /** + * Inverse next matcher. If you know how to test something, `.not` lets you test its opposite. + */ + not: Matchers; +}; + +type JestPromiseMatchers = { + /** + * Unwraps the reason of a rejected promise so any other matcher can be chained. + * If the promise is fulfilled the assertion fails. + */ + rejects: JestMatchers, T> & + JestInverse, T>>; + /** + * Unwraps the value of a fulfilled promise so any other matcher can be chained. + * If the promise is rejected the assertion fails. + */ + resolves: JestMatchers, T> & + JestInverse, T>>; +}; + +type JestExpect = { + (actual: T): JestMatchers & + JestInverse> & + JestPromiseMatchers; + addSnapshotSerializer: (arg: Plugin) => void; +} & BaseExpect & + AsymmetricMatchers & + JestInverse> & + jest.Expect; + +type JestItEach = Global.It['each']; + +interface JestEach extends JestItEach { + (strings: TemplateStringsArray, ...placeholders: any[]): ( + name: string, + fn: (arg: any) => ReturnType, + timeout?: number + ) => void; +} + +interface JestIt extends Global.It { + // TODO: override, because type issues (#7154) + each: JestEach; +} + +declare global { + const afterAll: Global.HookBase; + const afterEach: Global.HookBase; + const beforeAll: Global.HookBase; + const beforeEach: Global.HookBase; + const describe: Global.Describe; + const expect: JestExpect; + const it: JestIt; + const jest: Omit & { + // TODO: override, because type issues (#7154) + fn(): jest.Mock; + fn(implementation?: (...args: Y) => T): jest.Mock; + }; + const test: JestIt; + + // eslint-disable-next-line @typescript-eslint/no-namespace + namespace jest { + /** + * Wraps a class, function or object type with Jest mock type definitions. + */ + type Mocked = JestMocked; + /** + * Wraps a class type with Jest mock type definitions. + */ + type MockedClass = JestMockedClass; + /** + * Wraps a function type with Jest mock type definitions. + */ + type MockedFunction = JestMockedFunction; + /** + * Wraps an object type with Jest mock type definitions. + */ + type MockedObject = JestMockedObject; + + type MockInstance = JestMockInstance<(...args: Y) => T>; + + interface Mock + extends Function, + MockInstance { + new (...args: Y): T; + (...args: Y): T; + } + + interface CustomMatcherResult { + pass: boolean; + message: string | (() => string); + } + + type SpyInstance = JestSpyInstance<(...args: Y) => T>; + + // Extension point for jest matchers + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface Expect {} + // Extension point for jest matchers + // eslint-disable-next-line @typescript-eslint/no-empty-interface, @typescript-eslint/no-unused-vars + interface Matchers {} + } +} diff --git a/test/util.ts b/test/util.ts index 37fe6735f8f505..e7aed38653f0c0 100644 --- a/test/util.ts +++ b/test/util.ts @@ -1,10 +1,11 @@ import crypto from 'crypto'; -import { expect } from '@jest/globals'; +import { expect, jest } from '@jest/globals'; +import type { Plugin } from 'pretty-format'; import upath from 'upath'; import { getConfig } from '../lib/config/defaults'; import type { RenovateConfig } from '../lib/config/types'; import * as _logger from '../lib/logger'; -import { platform as _platform } from '../lib/modules/platform'; +import { Platform, platform as _platform } from '../lib/modules/platform'; import * as _env from '../lib/util/exec/env'; import * as _fs from '../lib/util/fs'; import * as _git from '../lib/util/git'; @@ -14,8 +15,8 @@ import * as _hostRules from '../lib/util/host-rules'; * Simple wrapper for getting mocked version of a module * @param module module which is mocked by `jest.mock` */ -export function mocked(module: T): jest.Mocked { - return module as jest.Mocked; +export function mocked(module: T): jest.MockedObject { + return module as jest.MockedObject; } /** @@ -38,7 +39,9 @@ export function partial(obj: Partial): T { export const fs = mocked(_fs); export const git = mocked(_git); -export const platform = mocked(_platform); + +// TODO: fix types, jest / typescript is using wrong overload (#7154) +export const platform = mocked(partial>(_platform)); export const env = mocked(_env); export const hostRules = mocked(_hostRules); export const logger = mocked(_logger); @@ -96,7 +99,7 @@ export function getFixturePath(fixtureFile: string, fixtureRoot = '.'): string { export const replacingSerializer = ( search: string, replacement: string -): jest.SnapshotSerializerPlugin => ({ +): Plugin => ({ test: (value) => typeof value === 'string' && value.includes(search), serialize: (val, config, indent, depth, refs, printer) => { const replaced = (val as string).replace(search, replacement); @@ -112,7 +115,7 @@ function toHash(buf: Buffer): string { return crypto.createHash('sha256').update(buf).digest('hex'); } -const bufferSerializer: jest.SnapshotSerializerPlugin = { +const bufferSerializer: Plugin = { test: (value) => Buffer.isBuffer(value), serialize: (val, config, indent, depth, refs, printer) => { const replaced = toHash(val); diff --git a/test/website-docs.spec.ts b/test/website-docs.spec.ts index b398d2bb6471ee..4691e9fac0b964 100644 --- a/test/website-docs.spec.ts +++ b/test/website-docs.spec.ts @@ -7,13 +7,13 @@ declare global { // eslint-disable-next-line @typescript-eslint/no-namespace namespace jest { type ContainsOption = T extends ArrayLike ? T[number] : unknown; - // eslint-disable-next-line @typescript-eslint/no-unused-vars - interface Matchers { + + interface Matchers { /** * only available in `test/website-docs.spec.js` * @param arg Value which current values should contain */ - toContainOption(arg: ContainsOption): void; + toContainOption(arg: ContainsOption): void; } } } diff --git a/tsconfig.json b/tsconfig.json index 718277526aa8d1..eae7305558df3b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,7 +17,7 @@ "useUnknownInCatchVariables": false /* we aren't prepared for enabling this by default since ts 4.4*/, "isolatedModules": true /* required for esbuild */, "lib": ["es2020"], - "types": ["node", "jest", "jest-extended", "expect-more-jest"], + "types": ["node", "jest-extended", "expect-more-jest"], "allowJs": true, "checkJs": true, "importsNotUsedAsValues": "error" diff --git a/yarn.lock b/yarn.lock index 3bb377d1635b4c..b142fefd3bf233 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1496,7 +1496,7 @@ got "11.8.5" luxon "3.0.1" -"@jest/console@^29.0.1", "@jest/console@^29.0.3": +"@jest/console@^29.0.2", "@jest/console@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.0.3.tgz#a222ab87e399317a89db88a58eaec289519e807a" integrity sha512-cGg0r+klVHSYnfE977S9wmpuQ9L+iYuYgL+5bPXiUlUynLLYunRxswEmhBzvrSKGof5AKiHuTTmUKAqRcDY9dg== @@ -1508,7 +1508,7 @@ jest-util "^29.0.3" slash "^3.0.0" -"@jest/core@^29.0.1", "@jest/core@^29.0.3": +"@jest/core@^29.0.2", "@jest/core@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.0.3.tgz#ba22a9cbd0c7ba36e04292e2093c547bf53ec1fd" integrity sha512-1d0hLbOrM1qQE3eP3DtakeMbKTcXiXP3afWxqz103xPyddS2NhnNghS7MaXx1dcDt4/6p4nlhmeILo2ofgi8cQ== @@ -1542,7 +1542,7 @@ slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/environment@^29.0.1", "@jest/environment@^29.0.3": +"@jest/environment@^29.0.2", "@jest/environment@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.0.3.tgz#7745ec30a954e828e8cc6df6a13280d3b51d8f35" integrity sha512-iKl272NKxYNQNqXMQandAIwjhQaGw5uJfGXduu8dS9llHi8jV2ChWrtOAVPnMbaaoDhnI3wgUGNDvZgHeEJQCA== @@ -1559,13 +1559,6 @@ dependencies: jest-get-type "^28.0.2" -"@jest/expect-utils@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" - integrity sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA== - dependencies: - jest-get-type "^28.0.2" - "@jest/expect-utils@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.3.tgz#f5bb86f5565bf2dacfca31ccbd887684936045b2" @@ -1573,7 +1566,7 @@ dependencies: jest-get-type "^29.0.0" -"@jest/expect@^29.0.1", "@jest/expect@^29.0.3": +"@jest/expect@^29.0.2", "@jest/expect@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.0.3.tgz#9dc7c46354eeb7a348d73881fba6402f5fdb2c30" integrity sha512-6W7K+fsI23FQ01H/BWccPyDZFrnU9QlzDcKOjrNVU5L8yUORFAJJIpmyxWPW70+X624KUNqzZwPThPMX28aXEQ== @@ -1593,15 +1586,15 @@ jest-mock "^29.0.3" jest-util "^29.0.3" -"@jest/globals@29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.1.tgz#764135ad31408fb632b3126793ab3aaed933095f" - integrity sha512-BtZWrVrKRKNUt7T1H2S8Mz31PN7ItROCmH+V5pn10hJDUfjOCTIUwb0WtLZzm0f1tJ3Uvx+5lVZrF/VTKqNaFg== +"@jest/globals@29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.0.2.tgz#605d3389ad0c6bfe17ad3e1359b5bc39aefd8b65" + integrity sha512-4hcooSNJCVXuTu07/VJwCWW6HTnjLtQdqlcGisK6JST7z2ixa8emw4SkYsOk7j36WRc2ZUEydlUePnOIOTCNXg== dependencies: - "@jest/environment" "^29.0.1" - "@jest/expect" "^29.0.1" - "@jest/types" "^29.0.1" - jest-mock "^29.0.1" + "@jest/environment" "^29.0.2" + "@jest/expect" "^29.0.2" + "@jest/types" "^29.0.2" + jest-mock "^29.0.2" "@jest/globals@^29.0.3": version "29.0.3" @@ -1613,16 +1606,16 @@ "@jest/types" "^29.0.3" jest-mock "^29.0.3" -"@jest/reporters@29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.1.tgz#82a491657031c1cc278bf659905e5094973309ad" - integrity sha512-dM3L8JmYYOsdeXUUVZClQy67Tz/v1sMo9h4AQv2U+716VLHV0zdA6Hh4FQNAHMhYw/95dbZbPX8Q+TRR7Rw+wA== +"@jest/reporters@29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.0.2.tgz#5f927646b6f01029525c05ac108324eac7d7ad5c" + integrity sha512-Kr41qejRQHHkCgWHC9YwSe7D5xivqP4XML+PvgwsnRFaykKdNflDUb4+xLXySOU+O/bPkVdFpGzUpVNSJChCrw== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.0.1" - "@jest/test-result" "^29.0.1" - "@jest/transform" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/test-result" "^29.0.2" + "@jest/transform" "^29.0.2" + "@jest/types" "^29.0.2" "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" @@ -1635,9 +1628,9 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^29.0.1" - jest-util "^29.0.1" - jest-worker "^29.0.1" + jest-message-util "^29.0.2" + jest-util "^29.0.2" + jest-worker "^29.0.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" @@ -1698,17 +1691,17 @@ callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.1.tgz#97ac334e4c6f7d016c341cdd500aa423a38e4cdd" - integrity sha512-XCA4whh/igxjBaR/Hg8qwFd/uTsauoD7QAdAYUjV2CSGx0+iunhjoCRRWTwqjQrETRqOJABx6kNfw0+C0vMSgQ== +"@jest/test-result@29.0.2": + version "29.0.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.2.tgz#dde4922e6234dd311c85ddf1ec2b7f600a90295d" + integrity sha512-b5rDc0lLL6Kx73LyCx6370k9uZ8o5UKdCpMS6Za3ke7H9y8PtAU305y6TeghpBmf2In8p/qqi3GpftgzijSsNw== dependencies: - "@jest/console" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/console" "^29.0.2" + "@jest/types" "^29.0.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-result@^29.0.1", "@jest/test-result@^29.0.3": +"@jest/test-result@^29.0.2", "@jest/test-result@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.0.3.tgz#b03d8ef4c58be84cd5d5d3b24d4b4c8cabbf2746" integrity sha512-vViVnQjCgTmbhDKEonKJPtcFe9G/CJO4/Np4XwYJah+lF2oI7KKeRp8t1dFvv44wN2NdbDb/qC6pi++Vpp0Dlg== @@ -1728,7 +1721,7 @@ jest-haste-map "^29.0.3" slash "^3.0.0" -"@jest/transform@^29.0.1", "@jest/transform@^29.0.3": +"@jest/transform@^29.0.2", "@jest/transform@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.0.3.tgz#9eb1fed2072a0354f190569807d1250572fb0970" integrity sha512-C5ihFTRYaGDbi/xbRQRdbo5ddGtI4VSpmL6AIcZxdhwLbXMa7PcXxxqyI91vGOFHnn5aVM3WYnYKCHEqmLVGzg== @@ -1749,19 +1742,7 @@ slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" - integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== - dependencies: - "@jest/schemas" "^28.1.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^29.0.1", "@jest/types@^29.0.3": +"@jest/types@^29.0.2", "@jest/types@^29.0.3": version "29.0.3" resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.3.tgz#0be78fdddb1a35aeb2041074e55b860561c8ef63" integrity sha512-coBJmOQvurXjN1Hh5PzF7cmsod0zLIOXpP8KD161mqNlroMhLcwpODiEzi7ZsRl5Z/AIuxpeNm8DCl43F4kz8A== @@ -2244,7 +2225,6 @@ "@renovate/eslint-plugin@https://github.com/renovatebot/eslint-plugin#v0.0.4": version "0.0.4" - uid "0c444386e79d6145901212507521b8a0a48af000" resolved "https://github.com/renovatebot/eslint-plugin#0c444386e79d6145901212507521b8a0a48af000" "@renovatebot/pep440@2.1.5": @@ -2672,14 +2652,6 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@28.1.7": - version "28.1.7" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.7.tgz#a680c5d05b69634c2d54a63cb106d7fb1adaba16" - integrity sha512-acDN4VHD40V24tgu0iC44jchXavRNVFXQ/E6Z5XNsswgoSO/4NgsXoEYmPUGookKldlZQyIpmrEXsHI9cA3ZTA== - dependencies: - expect "^28.0.0" - pretty-format "^28.0.0" - "@types/js-yaml@4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/js-yaml/-/js-yaml-4.0.5.tgz#738dd390a6ecc5442f35e7f03fa1431353f7e138" @@ -4796,17 +4768,6 @@ expect-more@1.2.0: resolved "https://registry.yarnpkg.com/expect-more/-/expect-more-1.2.0.tgz#cc7b3b6ad194ee54deaf601cf5c80449ed7a276d" integrity sha512-AVnjc5oh2jgiJjOrjbiKxbwLlNA/zsl2044Nbd09H4+2KwThtSLYKhdOusLYOrcToFAa2uBOWR1ExCN4kOWgbQ== -expect@^28.0.0: - version "28.1.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" - integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== - dependencies: - "@jest/expect-utils" "^28.1.3" - jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" - expect@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.3.tgz#6be65ddb945202f143c4e07c083f4f39f3bd326f" @@ -5979,7 +5940,7 @@ jest-circus@^29.0.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^29.0.1: +jest-cli@^29.0.2: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.0.3.tgz#fd8f0ef363a7a3d9c53ef62e0651f18eeffa77b9" integrity sha512-aUy9Gd/Kut1z80eBzG10jAn6BgS3BoBbXyv+uXEqBJ8wnnuZ5RpNfARoskSrTIy1GY4a8f32YGuCMwibtkl9CQ== @@ -6025,7 +5986,7 @@ jest-config@^29.0.3: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^28.1.0, jest-diff@^28.1.3: +jest-diff@^28.1.0: version "28.1.3" resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== @@ -6140,16 +6101,6 @@ jest-matcher-utils@28.1.0: jest-get-type "^28.0.2" pretty-format "^28.1.0" -jest-matcher-utils@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" - integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== - dependencies: - chalk "^4.0.0" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" - jest-matcher-utils@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.3.tgz#b8305fd3f9e27cdbc210b21fc7dbba92d4e54560" @@ -6160,22 +6111,7 @@ jest-matcher-utils@^29.0.3: jest-get-type "^29.0.0" pretty-format "^29.0.3" -jest-message-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" - integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^28.1.3" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-message-util@^29.0.1, jest-message-util@^29.0.3: +jest-message-util@^29.0.2, jest-message-util@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.3.tgz#f0254e1ffad21890c78355726202cc91d0a40ea8" integrity sha512-7T8JiUTtDfppojosORAflABfLsLKMLkBHSWkjNQrjIltGoDzNGn7wEPOSfjqYAGTYME65esQzMJxGDjuLBKdOg== @@ -6197,7 +6133,7 @@ jest-mock-extended@2.0.6: dependencies: ts-essentials "^7.0.3" -jest-mock@^29.0.1, jest-mock@^29.0.3: +jest-mock@^29.0.2, jest-mock@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.0.3.tgz#4f0093f6a9cb2ffdb9c44a07a3912f0c098c8de9" integrity sha512-ort9pYowltbcrCVR43wdlqfAiFJXBx8l4uJDsD8U72LgBcetvEp+Qxj1W9ZYgMRoeAo+ov5cnAGF2B6+Oth+ww== @@ -6323,19 +6259,7 @@ jest-snapshot@^29.0.3: pretty-format "^29.0.3" semver "^7.3.5" -jest-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" - integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== - dependencies: - "@jest/types" "^28.1.3" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.0.0, jest-util@^29.0.1, jest-util@^29.0.3: +jest-util@^29.0.0, jest-util@^29.0.2, jest-util@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.3.tgz#06d1d77f9a1bea380f121897d78695902959fbc0" integrity sha512-Q0xaG3YRG8QiTC4R6fHjHQPaPpz9pJBEi0AeOE4mQh/FuWOijFjGXMMOfQEaU9i3z76cNR7FobZZUQnL6IyfdQ== @@ -6373,7 +6297,7 @@ jest-watcher@^29.0.3: jest-util "^29.0.3" string-length "^4.0.1" -jest-worker@^29.0.1, jest-worker@^29.0.3: +jest-worker@^29.0.2, jest-worker@^29.0.3: version "29.0.3" resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.0.3.tgz#c2ba0aa7e41eec9eb0be8e8a322ae6518df72647" integrity sha512-Tl/YWUugQOjoTYwjKdfJWkSOfhufJHO5LhXTSZC3TRoQKO+fuXnZAdoXXBlpLXKGODBL3OvdUasfDD4PcMe6ng== @@ -6382,15 +6306,15 @@ jest-worker@^29.0.1, jest-worker@^29.0.3: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.1.tgz#4a1c48d79fada0a47c686a111ed9411fd41cd584" - integrity sha512-liHkwzaW6iwQyhRBFj0A4ZYKcsQ7ers1s62CCT95fPeNzoxT/vQRWwjTT4e7jpSCwrvPP2t1VESuy7GrXcr2ug== +jest@29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.0.2.tgz#16e20003dbf8fb9ed7e6ab801579a77084e13fba" + integrity sha512-enziNbNUmXTcTaTP/Uq5rV91r0Yqy2UKzLUIabxMpGm9YHz8qpbJhiRnNVNvm6vzWfzt/0o97NEHH8/3udoClA== dependencies: - "@jest/core" "^29.0.1" - "@jest/types" "^29.0.1" + "@jest/core" "^29.0.2" + "@jest/types" "^29.0.2" import-local "^3.0.2" - jest-cli "^29.0.1" + jest-cli "^29.0.2" js-tokens@^4.0.0: version "4.0.0" @@ -7565,7 +7489,6 @@ npm@^8.3.0: "@npmcli/fs" "^2.1.0" "@npmcli/map-workspaces" "^2.0.3" "@npmcli/package-json" "^2.0.0" - "@npmcli/promise-spawn" "^3.0.0" "@npmcli/run-script" "^4.2.1" abbrev "~1.1.1" archy "~1.0.0" @@ -7576,7 +7499,6 @@ npm@^8.3.0: cli-table3 "^0.6.2" columnify "^1.6.0" fastest-levenshtein "^1.0.12" - fs-minipass "^2.1.0" glob "^8.0.1" graceful-fs "^4.2.10" hosted-git-info "^5.1.0" @@ -7596,7 +7518,6 @@ npm@^8.3.0: libnpmteam "^4.0.4" libnpmversion "^3.0.7" make-fetch-happen "^10.2.0" - minimatch "^5.1.0" minipass "^3.1.6" minipass-pipeline "^1.2.4" mkdirp "^1.0.4" @@ -8078,15 +7999,6 @@ pretty-bytes@^5.1.0: resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== -pretty-format@^28.0.0, pretty-format@^29.0.0, pretty-format@^29.0.3: - version "29.0.3" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811" - integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q== - dependencies: - "@jest/schemas" "^29.0.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - pretty-format@^28.1.0, pretty-format@^28.1.3: version "28.1.3" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.3.tgz#c9fba8cedf99ce50963a11b27d982a9ae90970d5" @@ -8097,6 +8009,15 @@ pretty-format@^28.1.0, pretty-format@^28.1.3: ansi-styles "^5.0.0" react-is "^18.0.0" +pretty-format@^29.0.0, pretty-format@^29.0.3: + version "29.0.3" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.3.tgz#23d5f8cabc9cbf209a77d49409d093d61166a811" + integrity sha512-cHudsvQr1K5vNVLbvYF/nv3Qy/F/BcEKxGuIeMiVMRHxPOO1RxXooP8g/ZrwAp7Dx+KdMZoOc7NxLHhMrP2f9Q== + dependencies: + "@jest/schemas" "^29.0.0" + ansi-styles "^5.0.0" + react-is "^18.0.0" + pretty-quick@3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.3.tgz#15281108c0ddf446675157ca40240099157b638e"