Skip to content

Commit

Permalink
Move away from jest globals
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey committed Jan 21, 2023
1 parent b8f4553 commit 68c6232
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 38 deletions.
22 changes: 1 addition & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"string-argv": "^0.3.1"
},
"devDependencies": {
"@jest/globals": "^29.3.1",
"@tsconfig/node16-strictest": "^1.0.4",
"@types/jest": "^29.2.6",
"@types/node": "^16.18.11",
"@types/semver": "^7.3.13",
"@types/semver-utils": "^1.1.1",
Expand Down
1 change: 1 addition & 0 deletions src/helpers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as path from "node:path";
import * as core from "@actions/core";
import * as httpClient from "@actions/http-client";
import * as tc from "@actions/tool-cache";
import { afterEach, beforeEach, describe, expect, jest, test } from "@jest/globals";
import serializer from "jest-serializer-path";

expect.addSnapshotSerializer(serializer);
Expand Down
34 changes: 18 additions & 16 deletions src/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable unicorn/no-null */
import * as cp from "node:child_process";

import * as core from "@actions/core";
import * as command from "@actions/core/lib/command";
import { afterEach, beforeEach, describe, expect, jest, test } from "@jest/globals";

import * as helpers from "./helpers";

Expand Down Expand Up @@ -67,8 +69,8 @@ describe("no comments", () => {
mockedCp.spawnSync.mockImplementation(() => ({
pid: -1,
output: [],
stdout: "",
stderr: "",
stdout: "" as any,
stderr: "" as any,
status: 0,
signal: null,
}));
Expand All @@ -80,8 +82,8 @@ describe("no comments", () => {
mockedCp.spawnSync.mockImplementation(() => ({
pid: -1,
output: [],
stdout: "",
stderr: "",
stdout: "" as any,
stderr: "" as any,
status: 1,
signal: null,
}));
Expand All @@ -106,8 +108,8 @@ describe("with comments", () => {
mockedCp.spawnSync.mockImplementation(() => ({
pid: -1,
output: [],
stdout: "",
stderr: "",
stdout: "" as any,
stderr: "" as any,
status: 2,
signal: null,
}));
Expand All @@ -119,8 +121,8 @@ describe("with comments", () => {
mockedCp.spawnSync.mockImplementation(() => ({
pid: -1,
output: [],
stdout: "}",
stderr: "",
stdout: "}" as any,
stderr: "" as any,
status: 0,
signal: null,
}));
Expand All @@ -132,8 +134,8 @@ describe("with comments", () => {
mockedCp.spawnSync.mockImplementation(() => ({
pid: -1,
output: [],
stdout: "{}",
stderr: "",
stdout: "{}" as any,
stderr: "" as any,
status: 0,
signal: null,
}));
Expand All @@ -152,8 +154,8 @@ describe("with comments", () => {
warningCount: 0,
informationCount: 0,
},
}),
stderr: "",
}) as any,
stderr: "" as any,
status: 0,
signal: null,
}));
Expand Down Expand Up @@ -204,8 +206,8 @@ describe("with comments", () => {
warningCount: 2,
informationCount: 1,
},
}),
stderr: "",
}) as any,
stderr: "" as any,
status: 1,
signal: null,
}));
Expand Down Expand Up @@ -244,8 +246,8 @@ describe("with comments", () => {
warningCount: 1,
informationCount: 1,
},
}),
stderr: "",
}) as any,
stderr: "" as any,
status: 1,
signal: null,
}));
Expand Down
1 change: 1 addition & 0 deletions src/schema.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { describe, expect, test } from "@jest/globals";
import { klona } from "klona";

import { parseNpmRegistryResponse, parseReport } from "./schema";
Expand Down

0 comments on commit 68c6232

Please sign in to comment.