From 510a4f266e14741b548c97029863597f853c75d8 Mon Sep 17 00:00:00 2001 From: Benjamin Janssens Date: Thu, 14 Aug 2025 15:32:52 +0200 Subject: [PATCH] test(catalog): make tests succeed again Signed-off-by: Benjamin Janssens --- plugins/catalog-backend-module-github/package.json | 3 ++- .../src/providers/GithubEntityProvider.test.ts | 9 +++++++-- yarn.lock | 9 +++++---- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/plugins/catalog-backend-module-github/package.json b/plugins/catalog-backend-module-github/package.json index f56ebd618e..8ef75d1722 100644 --- a/plugins/catalog-backend-module-github/package.json +++ b/plugins/catalog-backend-module-github/package.json @@ -74,7 +74,8 @@ "@backstage/cli": "workspace:^", "@types/lodash": "^4.14.151", "luxon": "^3.0.0", - "msw": "^2.0.0" + "msw": "^2.0.0", + "type-fest": "^4.41.0" }, "configSchema": "config.d.ts" } diff --git a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts index b9f69b5754..19042c0cd9 100644 --- a/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts +++ b/plugins/catalog-backend-module-github/src/providers/GithubEntityProvider.test.ts @@ -35,6 +35,7 @@ import { RepositoryEvent, RepositoryRenamedEvent, } from '@octokit/webhooks-types'; +import type { PartialDeep } from 'type-fest'; jest.mock('../lib/github', () => { return { @@ -673,7 +674,8 @@ describe('GithubEntityProvider', () => { topics: [], html_url: `https://github.com/${organization}/test-repo`, url: `https://github.com/${organization}/test-repo`, - } as Partial; + owner: { login: 'test-org' }, + } as PartialDeep; const catalogCommit = { added: [] as string[], @@ -1003,7 +1005,10 @@ describe('GithubEntityProvider', () => { topics: [], archived: action === 'archived', private: action !== 'publicized', - } as Partial; + owner: { + login: 'test-org', + }, + } as PartialDeep; const event = { action, diff --git a/yarn.lock b/yarn.lock index a3334417ab..d36d4bd7a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4482,6 +4482,7 @@ __metadata: luxon: "npm:^3.0.0" minimatch: "npm:^9.0.0" msw: "npm:^2.0.0" + type-fest: "npm:^4.41.0" uuid: "npm:^11.0.0" languageName: unknown linkType: soft @@ -47613,10 +47614,10 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^4.26.1": - version: 4.26.1 - resolution: "type-fest@npm:4.26.1" - checksum: 10/b82676194f80af228cb852e320d2ea8381c89d667d2e4d9f2bdfc8f254bccc039c7741a90c53617a4de0c9fdca8265ed18eb0888cd628f391c5c381c33a9f94b +"type-fest@npm:^4.26.1, type-fest@npm:^4.41.0": + version: 4.41.0 + resolution: "type-fest@npm:4.41.0" + checksum: 10/617ace794ac0893c2986912d28b3065ad1afb484cad59297835a0807dc63286c39e8675d65f7de08fafa339afcb8fe06a36e9a188b9857756ae1e92ee8bda212 languageName: node linkType: hard