Skip to content

Commit

Permalink
fix: clear core.summary mock
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics committed Sep 29, 2024
1 parent 4da41d4 commit be4c715
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions __tests__/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,7 @@
import { isPullRequest, getPath, ActionInputs } from "../src/github/utils.js";
import * as github from "@actions/github";
import { getPath, ActionInputs } from "../src/github/utils.js";
import Path from "node:path";
import { describe, expect, it, vi } from "vitest";
import { describe, expect, it } from "vitest";

vi.mock("@actions/github");
describe("isPullRequest", () => {
it("should return true if the context is a pull request", () => {
github.context.payload = { pull_request: {number: 1} };
expect(isPullRequest()).toBe(true);
});

it("should return false if the context is not a pull request", () => {
github.context.payload = {};
expect(isPullRequest()).toBe(false);
});
});

describe("getPath", () => {
it("should return the resolved path based on the input srcDir", () => {
Expand Down

0 comments on commit be4c715

Please sign in to comment.