Skip to content

Commit

Permalink
fix: clean up jest.mocks that aren't needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kristof-mattei committed Sep 22, 2023
1 parent 6e12707 commit fa78df4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
9 changes: 0 additions & 9 deletions src/tests/commands/crates.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import * as github from "@actions/github";
import * as http from "@actions/http-client";
import { type TypedResponse } from "@actions/http-client/lib/interfaces";

Expand All @@ -7,18 +6,10 @@ import { resolveVersion } from "commands/crates";
import { type CratesIO } from "schema";

jest.mock("@actions/http-client");
jest.mock("@actions/exec");
jest.mock("@actions/cache");

describe("resolveVersion", () => {
beforeEach(() => {
jest.resetAllMocks();
github.context.sha = "sha";

jest.spyOn(github.context, "repo", "get").mockReturnValue({
repo: "repo",
owner: "owner",
});
});

it("resolves", async () => {
Expand Down
8 changes: 0 additions & 8 deletions src/tests/commands/cross.test.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,13 @@
import * as core from "@actions/core";
import * as github from "@actions/github";
import * as io from "@actions/io";

import { Cross } from "core";

jest.mock("@actions/exec");
jest.mock("@actions/cache");

describe("cross", () => {
beforeEach(() => {
jest.resetAllMocks();
github.context.sha = "sha";

jest.spyOn(github.context, "repo", "get").mockReturnValue({
repo: "repo",
owner: "owner",
});
});

it("Cross", async () => {
Expand Down
1 change: 1 addition & 0 deletions src/tests/commands/rustup.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as io from "@actions/io";
import { RustUp } from "core";

jest.mock("@actions/io");

describe("rustup", () => {
beforeEach(() => {
jest.resetAllMocks();
Expand Down

0 comments on commit fa78df4

Please sign in to comment.