Skip to content

Commit dd1aa42

Browse files
committed
Rebase fallout
1 parent 119c063 commit dd1aa42

File tree

4 files changed

+78
-760
lines changed

4 files changed

+78
-760
lines changed

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,7 @@
420420
"devDependencies": {
421421
"@eslint/js": "^9.39.2",
422422
"@eslint/markdown": "^7.5.1",
423-
"@types/eventsource": "^3.0.0",
424-
"@types/node": "^22.14.1",
423+
"@types/node": "^18",
425424
"@types/proper-lockfile": "^4.1.4",
426425
"@types/semver": "^7.7.1",
427426
"@types/ua-parser-js": "0.7.39",
@@ -436,25 +435,22 @@
436435
"bufferutil": "^4.1.0",
437436
"coder": "https://github.com/coder/coder#main",
438437
"dayjs": "^1.11.19",
439-
"electron": "^39.2.6",
438+
"electron": "^39.2.7",
440439
"eslint": "^9.39.2",
441440
"eslint-config-prettier": "^10.1.8",
442441
"eslint-import-resolver-typescript": "^4.4.4",
443442
"eslint-plugin-import-x": "^4.16.1",
444443
"eslint-plugin-package-json": "^0.88.1",
445444
"eslint-plugin-prettier": "^5.5.4",
446-
"glob": "^13.0.0",
447445
"globals": "^16.5.0",
448446
"jsonc-eslint-parser": "^2.4.2",
449447
"memfs": "^4.51.1",
450-
"nyc": "^17.1.0",
451448
"prettier": "^3.7.4",
452449
"ts-loader": "^9.5.4",
453450
"typescript": "^5.9.3",
454451
"typescript-eslint": "^8.52.0",
455452
"utf-8-validate": "^6.0.6",
456453
"vitest": "^4.0.16",
457-
"vscode-test": "^1.5.0",
458454
"webpack": "^5.104.1",
459455
"webpack-cli": "^6.0.1"
460456
},

test/unit/api/coderApi.test.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import axios, {
77
import { type ProvisionerJobLog } from "coder/site/src/api/typesGenerated";
88
import { EventSource } from "eventsource";
99
import { ProxyAgent } from "proxy-agent";
10-
import { describe, it, expect, vi, beforeEach } from "vitest";
10+
import { describe, it, expect, vi, beforeEach, type Mock } from "vitest";
1111
import Ws from "ws";
1212

1313
import { CoderApi } from "@/api/coderApi";
@@ -70,7 +70,9 @@ vi.mock("@/api/streamingFetchAdapter", () => ({
7070
describe("CoderApi", () => {
7171
let mockLogger: ReturnType<typeof createMockLogger>;
7272
let mockConfig: MockConfigurationProvider;
73-
let mockAdapter: ReturnType<typeof vi.fn>;
73+
let mockAdapter: Mock<
74+
(config: InternalAxiosRequestConfig) => Promise<unknown>
75+
>;
7476
let api: CoderApi;
7577

7678
const createApi = (url = CODER_URL, token = AXIOS_TOKEN) => {
@@ -81,7 +83,9 @@ describe("CoderApi", () => {
8183
vi.resetAllMocks();
8284

8385
const axiosMock = axios as typeof axios & {
84-
__mockAdapter: ReturnType<typeof vi.fn>;
86+
__mockAdapter: Mock<
87+
(config: InternalAxiosRequestConfig) => Promise<unknown>
88+
>;
8589
};
8690
mockAdapter = axiosMock.__mockAdapter;
8791
mockAdapter.mockImplementation(mockAdapterImpl);

test/unit/login/loginCoordinator.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import axios, { type CreateAxiosDefaults } from "axios";
2-
import { describe, expect, it, vi } from "vitest";
2+
import { describe, expect, it, vi, type Mock } from "vitest";
33
import * as vscode from "vscode";
44

55
import { MementoManager } from "@/core/mementoManager";
@@ -61,7 +61,9 @@ vi.mock("@/api/streamingFetchAdapter", () => ({
6161
vi.mock("@/promptUtils");
6262

6363
// Type for axios with our mock adapter
64-
type MockedAxios = typeof axios & { __mockAdapter: ReturnType<typeof vi.fn> };
64+
type MockedAxios = typeof axios & {
65+
__mockAdapter: Mock<(config: Record<string, unknown>) => Promise<unknown>>;
66+
};
6567

6668
const TEST_URL = "https://coder.example.com";
6769
const TEST_HOSTNAME = "coder.example.com";

0 commit comments

Comments
 (0)