From 60d308cff09cadcda6140b456e808ab410acbe52 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Fri, 13 Mar 2026 19:53:34 +0000 Subject: [PATCH] test: fix CI type regressions --- src/daemon/schtasks.ts | 12 +++++-- .../server-methods/agent-wait-dedupe.test.ts | 3 +- src/gateway/server-runtime-config.test.ts | 10 ++++-- src/gateway/server.talk-config.test.ts | 3 +- src/infra/agent-events.test.ts | 4 +-- src/infra/errors.test.ts | 5 ++- src/infra/format-time/format-time.test.ts | 2 +- src/infra/install-mode-options.test.ts | 10 ++++-- src/infra/outbound/targets.test.ts | 9 ++++- ...rovider-usage.auth.normalizes-keys.test.ts | 9 +++-- src/infra/provider-usage.fetch.shared.test.ts | 12 ++++--- src/infra/safe-open-sync.test.ts | 36 ++++++++++++++----- src/infra/update-channels.test.ts | 32 ++++++++++++----- src/infra/widearea-dns.test.ts | 7 ++-- src/line/bot-handlers.test.ts | 15 +++++--- src/plugins/loader.test.ts | 2 +- src/telegram/network-config.test.ts | 15 ++++++-- src/test-utils/exec-assertions.ts | 9 +---- 18 files changed, 138 insertions(+), 57 deletions(-) diff --git a/src/daemon/schtasks.ts b/src/daemon/schtasks.ts index 5453e6b26d8..2216e93bfd9 100644 --- a/src/daemon/schtasks.ts +++ b/src/daemon/schtasks.ts @@ -161,6 +161,12 @@ export type ScheduledTaskInfo = { lastRunResult?: string; }; +function hasListenerPid( + listener: T, +): listener is T & { pid: number } { + return typeof listener.pid === "number"; +} + export function parseSchtasksQuery(output: string): ScheduledTaskInfo { const entries = parseKeyValueOutput(output, ":"); const info: ScheduledTaskInfo = {}; @@ -388,7 +394,7 @@ async function resolveScheduledTaskGatewayListenerPids(port: number): Promise listener.pid) - .filter((pid): pid is number => Number.isFinite(pid) && pid > 0), + .filter((pid): pid is number => typeof pid === "number" && Number.isFinite(pid) && pid > 0), ), ); } @@ -472,7 +478,7 @@ async function terminateBusyPortListeners(port: number): Promise { new Set( diagnostics.listeners .map((listener) => listener.pid) - .filter((pid): pid is number => Number.isFinite(pid) && pid > 0), + .filter((pid): pid is number => typeof pid === "number" && Number.isFinite(pid) && pid > 0), ), ); for (const pid of pids) { @@ -496,7 +502,7 @@ async function resolveFallbackRuntime(env: GatewayServiceEnv): Promise typeof item.pid === "number"); + const listener = diagnostics.listeners.find(hasListenerPid); return { status: diagnostics.status === "busy" ? "running" : "stopped", ...(listener?.pid ? { pid: listener.pid } : {}), diff --git a/src/gateway/server-methods/agent-wait-dedupe.test.ts b/src/gateway/server-methods/agent-wait-dedupe.test.ts index c5204271983..4bbf2a575a0 100644 --- a/src/gateway/server-methods/agent-wait-dedupe.test.ts +++ b/src/gateway/server-methods/agent-wait-dedupe.test.ts @@ -1,4 +1,5 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; +import type { DedupeEntry } from "../server-shared.js"; import { __testing, readTerminalSnapshotFromGatewayDedupe, @@ -8,7 +9,7 @@ import { describe("agent wait dedupe helper", () => { function setRunEntry(params: { - dedupe: Map; + dedupe: Map; kind: "agent" | "chat"; runId: string; ts?: number; diff --git a/src/gateway/server-runtime-config.test.ts b/src/gateway/server-runtime-config.test.ts index 205bac8cf3e..5c1354d7cd5 100644 --- a/src/gateway/server-runtime-config.test.ts +++ b/src/gateway/server-runtime-config.test.ts @@ -251,7 +251,7 @@ describe("resolveGatewayRuntimeConfig", () => { }); describe("HTTP security headers", () => { - it.each([ + const cases = [ { name: "resolves strict transport security headers from config", strictTransportSecurity: " max-age=31536000; includeSubDomains ", @@ -267,7 +267,13 @@ describe("resolveGatewayRuntimeConfig", () => { strictTransportSecurity: " ", expected: undefined, }, - ])("$name", async ({ strictTransportSecurity, expected }) => { + ] satisfies ReadonlyArray<{ + name: string; + strictTransportSecurity: string | false; + expected: string | undefined; + }>; + + it.each(cases)("$name", async ({ strictTransportSecurity, expected }) => { const result = await resolveGatewayRuntimeConfig({ cfg: { gateway: { diff --git a/src/gateway/server.talk-config.test.ts b/src/gateway/server.talk-config.test.ts index 6723f30cd45..a47addbb0e0 100644 --- a/src/gateway/server.talk-config.test.ts +++ b/src/gateway/server.talk-config.test.ts @@ -40,6 +40,7 @@ type TalkConfigPayload = { ui?: { seamColor?: string }; }; }; +type TalkConfig = NonNullable["talk"]>; const TALK_CONFIG_DEVICE_PATH = path.join( os.tmpdir(), `openclaw-talk-config-device-${process.pid}.json`, @@ -95,7 +96,7 @@ async function fetchTalkConfig( } function expectElevenLabsTalkConfig( - talk: TalkConfigPayload["config"] extends { talk?: infer T } ? T : never, + talk: TalkConfig | undefined, expected: { voiceId?: string; apiKey?: string | SecretRef; diff --git a/src/infra/agent-events.test.ts b/src/infra/agent-events.test.ts index 7f65ff5f752..0079a443c7b 100644 --- a/src/infra/agent-events.test.ts +++ b/src/infra/agent-events.test.ts @@ -91,13 +91,13 @@ describe("agent-events sequencing", () => { isControlUiVisible: true, }); registerAgentRunContext("run-ctx", { - verboseLevel: "high", + verboseLevel: "full", isHeartbeat: true, }); expect(getAgentRunContext("run-ctx")).toEqual({ sessionKey: "session-main", - verboseLevel: "high", + verboseLevel: "full", isHeartbeat: true, isControlUiVisible: true, }); diff --git a/src/infra/errors.test.ts b/src/infra/errors.test.ts index 3a9387edc70..45b6b73e395 100644 --- a/src/infra/errors.test.ts +++ b/src/infra/errors.test.ts @@ -32,7 +32,10 @@ describe("error helpers", () => { child.cause = root; expect( - collectErrorGraphCandidates(root, (current) => [current.cause, ...(current.errors ?? [])]), + collectErrorGraphCandidates(root, (current) => [ + current.cause, + ...((current as { errors?: unknown[] }).errors ?? []), + ]), ).toEqual([root, child, leaf]); expect(collectErrorGraphCandidates(null)).toEqual([]); }); diff --git a/src/infra/format-time/format-time.test.ts b/src/infra/format-time/format-time.test.ts index 42323523f68..f3fddff7f6d 100644 --- a/src/infra/format-time/format-time.test.ts +++ b/src/infra/format-time/format-time.test.ts @@ -192,7 +192,7 @@ describe("format-datetime", () => { formatToParts: () => { throw new Error("boom"); }, - } as Intl.DateTimeFormat; + } as unknown as Intl.DateTimeFormat; } vi.spyOn(Intl, "DateTimeFormat").mockImplementation( diff --git a/src/infra/install-mode-options.test.ts b/src/infra/install-mode-options.test.ts index 3e3c7297471..6fd450ee370 100644 --- a/src/infra/install-mode-options.test.ts +++ b/src/infra/install-mode-options.test.ts @@ -4,6 +4,8 @@ import { resolveTimedInstallModeOptions, } from "./install-mode-options.js"; +type LoggerKey = "default" | "explicit"; + describe("install mode option helpers", () => { it.each([ { @@ -21,11 +23,15 @@ describe("install mode option helpers", () => { params: { mode: "update" as const, dryRun: false }, expected: { loggerKey: "default", mode: "update", dryRun: false }, }, - ])("$name", ({ params, expected }) => { + ] satisfies Array<{ + name: string; + params: { loggerKey?: LoggerKey; mode?: "install" | "update"; dryRun?: boolean }; + expected: { loggerKey: LoggerKey; mode: "install" | "update"; dryRun: boolean }; + }>)("$name", ({ params, expected }) => { const loggers = { default: { warn: (_message: string) => {} }, explicit: { warn: (_message: string) => {} }, - }; + } satisfies Record void }>; expect( resolveInstallModeOptions( diff --git a/src/infra/outbound/targets.test.ts b/src/infra/outbound/targets.test.ts index e0b669040a6..b9c795f532e 100644 --- a/src/infra/outbound/targets.test.ts +++ b/src/infra/outbound/targets.test.ts @@ -462,7 +462,14 @@ describe("resolveSessionDeliveryTarget", () => { expectedChannel: "none", expectedReason: "dm-blocked", }, - ])("$name", ({ name, entry, directPolicy, expectedChannel, expectedTo, expectedReason }) => { + ] satisfies Array<{ + name: string; + entry: NonNullable[0]["entry"]>; + directPolicy?: "allow" | "block"; + expectedChannel: string; + expectedTo?: string; + expectedReason?: string; + }>)("$name", ({ name, entry, directPolicy, expectedChannel, expectedTo, expectedReason }) => { expectHeartbeatTarget({ name, entry, diff --git a/src/infra/provider-usage.auth.normalizes-keys.test.ts b/src/infra/provider-usage.auth.normalizes-keys.test.ts index 851c789941d..baf96781c27 100644 --- a/src/infra/provider-usage.auth.normalizes-keys.test.ts +++ b/src/infra/provider-usage.auth.normalizes-keys.test.ts @@ -3,7 +3,7 @@ import os from "node:os"; import path from "node:path"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { NON_ENV_SECRETREF_MARKER } from "../agents/model-auth-markers.js"; -import { resolveProviderAuths } from "./provider-usage.auth.js"; +import { resolveProviderAuths, type ProviderAuth } from "./provider-usage.auth.js"; describe("resolveProviderAuths key normalization", () => { let suiteRoot = ""; @@ -214,7 +214,12 @@ describe("resolveProviderAuths key normalization", () => { }, expected: [{ provider: "minimax", token: "code-plan-key" }], }, - ])("$name", async ({ providers, env, expected }) => { + ] satisfies Array<{ + name: string; + providers: readonly Parameters[0]["providers"][number][]; + env: Record; + expected: ProviderAuth[]; + }>)("$name", async ({ providers, env, expected }) => { await expectResolvedAuthsFromSuiteHome({ providers: [...providers], env, expected }); }); diff --git a/src/infra/provider-usage.fetch.shared.test.ts b/src/infra/provider-usage.fetch.shared.test.ts index dea3097fa4a..692a57705db 100644 --- a/src/infra/provider-usage.fetch.shared.test.ts +++ b/src/infra/provider-usage.fetch.shared.test.ts @@ -32,10 +32,11 @@ describe("provider usage fetch shared helpers", () => { it("forwards request init and clears the timeout on success", async () => { vi.useFakeTimers(); const clearTimeoutSpy = vi.spyOn(globalThis, "clearTimeout"); - const fetchFn = vi.fn( - async (_url: string, init?: RequestInit) => + const fetchFnMock = vi.fn( + async (_input: URL | RequestInfo, init?: RequestInit) => new Response(JSON.stringify({ aborted: init?.signal?.aborted ?? false }), { status: 200 }), ); + const fetchFn = fetchFnMock as typeof fetch; const response = await fetchJson( "https://example.com/usage", @@ -47,7 +48,7 @@ describe("provider usage fetch shared helpers", () => { fetchFn, ); - expect(fetchFn).toHaveBeenCalledWith( + expect(fetchFnMock).toHaveBeenCalledWith( "https://example.com/usage", expect.objectContaining({ method: "POST", @@ -62,14 +63,15 @@ describe("provider usage fetch shared helpers", () => { it("aborts timed out requests and clears the timer on rejection", async () => { vi.useFakeTimers(); const clearTimeoutSpy = vi.spyOn(globalThis, "clearTimeout"); - const fetchFn = vi.fn( - (_url: string, init?: RequestInit) => + const fetchFnMock = vi.fn( + (_input: URL | RequestInfo, init?: RequestInit) => new Promise((_, reject) => { init?.signal?.addEventListener("abort", () => reject(new Error("aborted by timeout")), { once: true, }); }), ); + const fetchFn = fetchFnMock as typeof fetch; const request = fetchJson("https://example.com/usage", {}, 50, fetchFn); const rejection = expect(request).rejects.toThrow("aborted by timeout"); diff --git a/src/infra/safe-open-sync.test.ts b/src/infra/safe-open-sync.test.ts index 4848752a66e..726aa9195f1 100644 --- a/src/infra/safe-open-sync.test.ts +++ b/src/infra/safe-open-sync.test.ts @@ -5,6 +5,11 @@ import path from "node:path"; import { describe, expect, it } from "vitest"; import { openVerifiedFileSync } from "./safe-open-sync.js"; +type SafeOpenSyncFs = NonNullable[0]["ioFs"]>; +type SafeOpenSyncLstatSync = SafeOpenSyncFs["lstatSync"]; +type SafeOpenSyncRealpathSync = SafeOpenSyncFs["realpathSync"]; +type SafeOpenSyncFstatSync = SafeOpenSyncFs["fstatSync"]; + async function withTempDir(prefix: string, run: (dir: string) => Promise): Promise { const dir = await fsp.mkdtemp(path.join(os.tmpdir(), prefix)); try { @@ -33,6 +38,20 @@ function mockStat(params: { } as unknown as fs.Stats; } +function mockRealpathSync(result: string): SafeOpenSyncRealpathSync { + const resolvePath = ((_: fs.PathLike) => result) as SafeOpenSyncRealpathSync; + resolvePath.native = ((_: fs.PathLike) => result) as typeof resolvePath.native; + return resolvePath; +} + +function mockLstatSync(read: (filePath: fs.PathLike) => fs.Stats): SafeOpenSyncLstatSync { + return ((filePath: fs.PathLike) => read(filePath)) as unknown as SafeOpenSyncLstatSync; +} + +function mockFstatSync(stat: fs.Stats): SafeOpenSyncFstatSync { + return ((_: number) => stat) as unknown as SafeOpenSyncFstatSync; +} + describe("openVerifiedFileSync", () => { it("returns a path error for missing files", async () => { await withTempDir("openclaw-safe-open-", async (root) => { @@ -115,15 +134,16 @@ describe("openVerifiedFileSync", () => { closed.push(fd); }; const closed: number[] = []; - const ioFs = { + const ioFs: SafeOpenSyncFs = { constants: fs.constants, - lstatSync: (filePath: string) => - filePath === "/real/file.txt" + lstatSync: mockLstatSync((filePath) => + String(filePath) === "/real/file.txt" ? mockStat({ isFile: true, size: 1, dev: 1, ino: 1 }) : mockStat({ isFile: false }), - realpathSync: () => "/real/file.txt", + ), + realpathSync: mockRealpathSync("/real/file.txt"), openSync: () => 42, - fstatSync: () => mockStat({ isFile: true, size: 1, dev: 2, ino: 1 }), + fstatSync: mockFstatSync(mockStat({ isFile: true, size: 1, dev: 2, ino: 1 })), closeSync, }; @@ -139,16 +159,16 @@ describe("openVerifiedFileSync", () => { }); it("reports non-path filesystem failures as io errors", () => { - const ioFs = { + const ioFs: SafeOpenSyncFs = { constants: fs.constants, lstatSync: () => { const err = new Error("permission denied") as NodeJS.ErrnoException; err.code = "EACCES"; throw err; }, - realpathSync: () => "/real/file.txt", + realpathSync: mockRealpathSync("/real/file.txt"), openSync: () => 42, - fstatSync: () => mockStat({ isFile: true }), + fstatSync: mockFstatSync(mockStat({ isFile: true })), closeSync: () => {}, }; diff --git a/src/infra/update-channels.test.ts b/src/infra/update-channels.test.ts index c13476f356a..2738cc0ddad 100644 --- a/src/infra/update-channels.test.ts +++ b/src/infra/update-channels.test.ts @@ -7,6 +7,8 @@ import { normalizeUpdateChannel, resolveEffectiveUpdateChannel, resolveUpdateChannelDisplay, + type UpdateChannel, + type UpdateChannelSource, } from "./update-channels.js"; describe("update-channels tag detection", () => { @@ -32,9 +34,12 @@ describe("normalizeUpdateChannel", () => { { value: " nightly ", expected: null }, { value: null, expected: null }, { value: undefined, expected: null }, - ])("normalizes %j", ({ value, expected }) => { - expect(normalizeUpdateChannel(value)).toBe(expected); - }); + ] satisfies Array<{ value: string | null | undefined; expected: UpdateChannel | null }>)( + "normalizes %j", + ({ value, expected }) => { + expect(normalizeUpdateChannel(value)).toBe(expected); + }, + ); }); describe("channelToNpmTag", () => { @@ -42,9 +47,12 @@ describe("channelToNpmTag", () => { { channel: "stable", expected: "latest" }, { channel: "beta", expected: "beta" }, { channel: "dev", expected: "dev" }, - ])("maps $channel to $expected", ({ channel, expected }) => { - expect(channelToNpmTag(channel)).toBe(expected); - }); + ] satisfies Array<{ channel: UpdateChannel; expected: string }>)( + "maps $channel to $expected", + ({ channel, expected }) => { + expect(channelToNpmTag(channel)).toBe(expected); + }, + ); }); describe("resolveEffectiveUpdateChannel", () => { @@ -100,7 +108,11 @@ describe("resolveEffectiveUpdateChannel", () => { params: { installKind: "unknown" as const }, expected: { channel: "stable", source: "default" }, }, - ])("$name", ({ params, expected }) => { + ] satisfies Array<{ + name: string; + params: Parameters[0]; + expected: { channel: UpdateChannel; source: UpdateChannelSource }; + }>)("$name", ({ params, expected }) => { expect(resolveEffectiveUpdateChannel(params)).toEqual(expected); }); }); @@ -145,7 +157,11 @@ describe("formatUpdateChannelLabel", () => { params: { channel: "stable", source: "default" as const }, expected: "stable (default)", }, - ])("$name", ({ params, expected }) => { + ] satisfies Array<{ + name: string; + params: Parameters[0]; + expected: string; + }>)("$name", ({ params, expected }) => { expect(formatUpdateChannelLabel(params)).toBe(expected); }); }); diff --git a/src/infra/widearea-dns.test.ts b/src/infra/widearea-dns.test.ts index 7796fea087b..f2ab0c0f54f 100644 --- a/src/infra/widearea-dns.test.ts +++ b/src/infra/widearea-dns.test.ts @@ -7,19 +7,20 @@ import { normalizeWideAreaDomain, renderWideAreaGatewayZoneText, resolveWideAreaDiscoveryDomain, + type WideAreaGatewayZoneOpts, writeWideAreaGatewayZone, } from "./widearea-dns.js"; -const baseZoneOpts = { +const baseZoneOpts: WideAreaGatewayZoneOpts = { domain: "openclaw.internal.", gatewayPort: 18789, displayName: "Mac Studio (OpenClaw)", tailnetIPv4: "100.123.224.76", hostLabel: "studio-london", instanceLabel: "studio-london", -} as const; +}; -function makeZoneOpts(overrides: Partial = {}) { +function makeZoneOpts(overrides: Partial = {}): WideAreaGatewayZoneOpts { return { ...baseZoneOpts, ...overrides }; } diff --git a/src/line/bot-handlers.test.ts b/src/line/bot-handlers.test.ts index a2d012a32bb..7b3638f072b 100644 --- a/src/line/bot-handlers.test.ts +++ b/src/line/bot-handlers.test.ts @@ -678,7 +678,7 @@ describe("handleLineWebhookEvents", () => { it("skips group messages by default when requireMention is not configured", async () => { const processMessage = vi.fn(); const event = createTestMessageEvent({ - message: { id: "m-default-skip", type: "text", text: "hi there" }, + message: { id: "m-default-skip", type: "text", text: "hi there", quoteToken: "q-default" }, source: { type: "group", groupId: "group-default", userId: "user-default" }, webhookEventId: "evt-default-skip", }); @@ -702,7 +702,7 @@ describe("handleLineWebhookEvents", () => { import("../auto-reply/reply/history.js").HistoryEntry[] >(); const event = createTestMessageEvent({ - message: { id: "m-hist-1", type: "text", text: "hello history" }, + message: { id: "m-hist-1", type: "text", text: "hello history", quoteToken: "q-hist-1" }, timestamp: 1700000000000, source: { type: "group", groupId: "group-hist-1", userId: "user-hist" }, webhookEventId: "evt-hist-1", @@ -730,7 +730,7 @@ describe("handleLineWebhookEvents", () => { it("skips group messages without mention when requireMention is set", async () => { const processMessage = vi.fn(); const event = createTestMessageEvent({ - message: { id: "m-mention-1", type: "text", text: "hi there" }, + message: { id: "m-mention-1", type: "text", text: "hi there", quoteToken: "q-mention-1" }, source: { type: "group", groupId: "group-mention", userId: "user-mention" }, webhookEventId: "evt-mention-1", }); @@ -808,7 +808,7 @@ describe("handleLineWebhookEvents", () => { it("does not apply requireMention gating to DM messages", async () => { const processMessage = vi.fn(); const event = createTestMessageEvent({ - message: { id: "m-mention-dm", type: "text", text: "hi" }, + message: { id: "m-mention-dm", type: "text", text: "hi", quoteToken: "q-mention-dm" }, source: { type: "user", userId: "user-dm" }, webhookEventId: "evt-mention-dm", }); @@ -830,7 +830,12 @@ describe("handleLineWebhookEvents", () => { const processMessage = vi.fn(); // Image message -- LINE only carries mention metadata on text messages. const event = createTestMessageEvent({ - message: { id: "m-mention-img", type: "image", contentProvider: { type: "line" } }, + message: { + id: "m-mention-img", + type: "image", + contentProvider: { type: "line" }, + quoteToken: "q-mention-img", + }, source: { type: "group", groupId: "group-1", userId: "user-img" }, webhookEventId: "evt-mention-img", }); diff --git a/src/plugins/loader.test.ts b/src/plugins/loader.test.ts index d2ecfab18be..20d3fb22287 100644 --- a/src/plugins/loader.test.ts +++ b/src/plugins/loader.test.ts @@ -1488,7 +1488,7 @@ describe("loadOpenClawPlugins", () => { load: { paths: [plugin.file] }, }, }, - } as const; + }; loadOpenClawPlugins(options); loadOpenClawPlugins(options); diff --git a/src/telegram/network-config.test.ts b/src/telegram/network-config.test.ts index fad150e0d7f..70de5f46826 100644 --- a/src/telegram/network-config.test.ts +++ b/src/telegram/network-config.test.ts @@ -1,4 +1,5 @@ import { afterEach, describe, expect, it, vi } from "vitest"; +import type { TelegramNetworkConfig } from "../config/types.telegram.js"; import { resetTelegramNetworkConfigStateForTests, resolveTelegramAutoSelectFamilyDecision, @@ -157,7 +158,9 @@ describe("resolveTelegramDnsResultOrderDecision", () => { }, { name: "normalizes trimmed config values", - network: { dnsResultOrder: " Verbatim " }, + network: { dnsResultOrder: " Verbatim " } as TelegramNetworkConfig & { + dnsResultOrder: string; + }, nodeMajor: 20, expected: { value: "verbatim", source: "config" }, }, @@ -171,11 +174,17 @@ describe("resolveTelegramDnsResultOrderDecision", () => { { name: "ignores invalid env and config values before applying Node 22 default", env: { OPENCLAW_TELEGRAM_DNS_RESULT_ORDER: "bogus" }, - network: { dnsResultOrder: "invalid" }, + network: { dnsResultOrder: "invalid" } as TelegramNetworkConfig & { dnsResultOrder: string }, nodeMajor: 22, expected: { value: "ipv4first", source: "default-node22" }, }, - ])("$name", ({ env, network, nodeMajor, expected }) => { + ] satisfies Array<{ + name: string; + env?: NodeJS.ProcessEnv; + network?: TelegramNetworkConfig | (TelegramNetworkConfig & { dnsResultOrder: string }); + nodeMajor: number; + expected: ReturnType; + }>)("$name", ({ env, network, nodeMajor, expected }) => { const decision = resolveTelegramDnsResultOrderDecision({ env, network, diff --git a/src/test-utils/exec-assertions.ts b/src/test-utils/exec-assertions.ts index 58b77f9f730..6e9149725ef 100644 --- a/src/test-utils/exec-assertions.ts +++ b/src/test-utils/exec-assertions.ts @@ -28,14 +28,7 @@ export function expectSingleNpmInstallIgnoreScriptsCall(params: { throw new Error("expected npm install call"); } const [argv, opts] = first; - expect(argv).toEqual([ - "npm", - "install", - "--omit=dev", - "--omit=peer", - "--silent", - "--ignore-scripts", - ]); + expect(argv).toEqual(["npm", "install", "--omit=dev", "--silent", "--ignore-scripts"]); expect(opts?.cwd).toBeTruthy(); const cwd = String(opts?.cwd); const expectedTargetDir = params.expectedTargetDir;