From 35ec79c8e5d1fd9b8351422bec63f42dca31a897 Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Mon, 6 Jan 2025 12:27:56 +0900 Subject: [PATCH] test: fixing context values --- tests/fees.test.ts | 1 + tests/pre-check.test.ts | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/fees.test.ts b/tests/fees.test.ts index 63797ec7..9b194d00 100644 --- a/tests/fees.test.ts +++ b/tests/fees.test.ts @@ -13,6 +13,7 @@ jest.unstable_mockModule("../src/helpers/web3", () => ({ })); jest.unstable_mockModule("@actions/github", () => ({ + default: {}, context: { runId: "1", payload: { diff --git a/tests/pre-check.test.ts b/tests/pre-check.test.ts index 44306681..b97ff13e 100644 --- a/tests/pre-check.test.ts +++ b/tests/pre-check.test.ts @@ -11,17 +11,22 @@ import { customOctokit as Octokit } from "@ubiquity-os/plugin-sdk/octokit"; const issueUrl = "https://github.com/ubiquity/work.ubq.fi/issues/69"; -jest.unstable_mockModule("@actions/github", () => ({ - default: {}, - context: { +jest.unstable_mockModule("@actions/github", () => { + const context = { runId: "1", payload: { repository: { html_url: "https://github.com/ubiquity-os/conversation-rewards", }, }, - }, -})); + }; + return { + default: { + context, + }, + context, + }; +}); beforeAll(() => server.listen()); afterEach(() => server.resetHandlers());