diff --git a/package-lock.json b/package-lock.json index c9a9545..7d24968 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,8 +18,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", @@ -1714,16 +1714,6 @@ "@types/istanbul-lib-report": "*" } }, - "node_modules/@types/jest": { - "version": "29.2.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.6.tgz", - "integrity": "sha512-XEUC/Tgw3uMh6Ho8GkUtQ2lPhY5Fmgyp3TdlkTJs1W9VgNxs+Ow/x3Elh8lHQKqCbZL0AubQuqWjHVT033Hhrw==", - "dev": true, - "dependencies": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "node_modules/@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", @@ -6955,16 +6945,6 @@ "@types/istanbul-lib-report": "*" } }, - "@types/jest": { - "version": "29.2.6", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.2.6.tgz", - "integrity": "sha512-XEUC/Tgw3uMh6Ho8GkUtQ2lPhY5Fmgyp3TdlkTJs1W9VgNxs+Ow/x3Elh8lHQKqCbZL0AubQuqWjHVT033Hhrw==", - "dev": true, - "requires": { - "expect": "^29.0.0", - "pretty-format": "^29.0.0" - } - }, "@types/json-schema": { "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", diff --git a/package.json b/package.json index 0dde180..cb4d7e2 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/helpers.test.ts b/src/helpers.test.ts index a7208d3..c2467f4 100644 --- a/src/helpers.test.ts +++ b/src/helpers.test.ts @@ -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); diff --git a/src/main.test.ts b/src/main.test.ts index 4f251fc..ca55ff8 100644 --- a/src/main.test.ts +++ b/src/main.test.ts @@ -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"; @@ -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, })); @@ -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, })); @@ -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, })); @@ -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, })); @@ -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, })); @@ -152,8 +154,8 @@ describe("with comments", () => { warningCount: 0, informationCount: 0, }, - }), - stderr: "", + }) as any, + stderr: "" as any, status: 0, signal: null, })); @@ -204,8 +206,8 @@ describe("with comments", () => { warningCount: 2, informationCount: 1, }, - }), - stderr: "", + }) as any, + stderr: "" as any, status: 1, signal: null, })); @@ -244,8 +246,8 @@ describe("with comments", () => { warningCount: 1, informationCount: 1, }, - }), - stderr: "", + }) as any, + stderr: "" as any, status: 1, signal: null, })); diff --git a/src/schema.test.ts b/src/schema.test.ts index 4d38dfa..ec9b772 100644 --- a/src/schema.test.ts +++ b/src/schema.test.ts @@ -1,3 +1,4 @@ +import { describe, expect, test } from "@jest/globals"; import { klona } from "klona"; import { parseNpmRegistryResponse, parseReport } from "./schema";