Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions __test__/channel_linux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { LinuxChannelInstaller } from "../src/channel_linux";

const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
vi.mock("@actions/tool-cache");
vi.mock("../src/cache");

const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const tcExtractZipSpy = vi.mocked(tc.extractZip);

afterEach(() => {
vi.resetAllMocks();
Expand Down
11 changes: 7 additions & 4 deletions __test__/channel_macos.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { MacOSChannelInstaller } from "../src/channel_macos";

const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
vi.mock("@actions/tool-cache");
vi.mock("../src/cache");

const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const tcExtractZipSpy = vi.mocked(tc.extractZip);

afterEach(() => {
vi.resetAllMocks();
Expand Down
11 changes: 7 additions & 4 deletions __test__/channel_windows.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { WindowsChannelInstaller } from "../src/channel_windows";

vi.mock("@actions/tool-cache");
vi.mock("../src/cache");

const fsRenameSpy = vi.spyOn(fs.promises, "rename");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const tcExtractZipSpy = vi.mocked(tc.extractZip);
const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);

afterEach(() => {
vi.resetAllMocks();
Expand Down
11 changes: 7 additions & 4 deletions __test__/latest_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { LatestInstaller } from "../src/latest_installer";

const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
vi.mock("@actions/tool-cache");
vi.mock("../src/cache");
vi.mock("../src/snapshot_bucket", () => ({
resolveLatestVersion: () => Promise.resolve("123456"),
browserDownloadURL: () => "https://example.com/chrome.zip",
driverDownloadURL: () => "https://example.com/chromedriver.zip",
}));

const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const tcExtractZipSpy = vi.mocked(tc.extractZip);

afterEach(() => {
vi.resetAllMocks();
});
Expand Down
11 changes: 7 additions & 4 deletions __test__/snapshot_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ import { afterEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { SnapshotInstaller } from "../src/snapshot_installer";

const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
vi.mock("@actions/tool-cache");
vi.mock("../src/cache");

const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const tcExtractZipSpy = vi.mocked(tc.extractZip);

afterEach(() => {
vi.resetAllMocks();
Expand Down
11 changes: 7 additions & 4 deletions __test__/version_installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
import * as cache from "../src/cache";
import { KnownGoodVersionInstaller } from "../src/version_installer";

vi.mock("@actions/tool-cache");
vi.mock("../src/cache");

const getJsonSpy = vi.spyOn(httpm.HttpClient.prototype, "getJson");
const tcExtractZipSpy = vi.spyOn(tc, "extractZip");
const tcDownloadToolSpy = vi.spyOn(tc, "downloadTool");
const cacheFindSpy = vi.spyOn(cache, "find");
const cacheCacheDirSpy = vi.spyOn(cache, "cacheDir");
const tcExtractZipSpy = vi.mocked(tc.extractZip);
const tcDownloadToolSpy = vi.mocked(tc.downloadTool);
const cacheFindSpy = vi.mocked(cache.find);
const cacheCacheDirSpy = vi.mocked(cache.cacheDir);

beforeEach(() => {
const mockDataPath = path.join(
Expand Down
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"files": {
"ignore": ["./dist/", "__test__/data/", "package.json"]
"includes": ["**", "!dist", "!__test__/data", "!package.json"]
},
"linter": {
"enabled": true,
Expand Down
23 changes: 12 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,34 @@
"name": "setup-chrome",
"version": "2.1.1",
"description": "Set up your GitHub Actions workflow with a specific version of chromium",
"type": "module",
"main": "dist/index.js",
"packageManager": "pnpm@8.7.5",
"engines": {
"node": ">=24.0.0"
},
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@actions/http-client": "^2.2.1",
"@actions/io": "^1.1.3",
"@actions/tool-cache": "^2.0.1",
"@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0",
"@actions/http-client": "^4.0.1",
"@actions/io": "^3.0.2",
"@actions/tool-cache": "^4.0.0",
"actions-swing": "^0.0.6"
},
"devDependencies": {
"@biomejs/biome": "^1.7.2",
"@types/node": "^20.6.2",
"@vercel/ncc": "^0.38.1",
"typescript": "^5.4.5",
"vitest": "^2.0.2"
"@biomejs/biome": "^2.4.14",
"@types/node": "^25.6.0",
"@vercel/ncc": "^0.38.4",
"typescript": "^6.0.3",
"vitest": "^4.1.5"
},
"scripts": {
"build": "ncc build src/index.ts",
"build:watch": "ncc build --watch src/index.ts",
"package": "cp action.yml README.md dist/",
"test": "vitest",
"lint": "biome ci .",
"lint:fix": "biome check --apply ."
"lint:fix": "biome check --write ."
},
"repository": {
"type": "git",
Expand Down
Loading
Loading