chore: Fix types in tests 45/N.

This commit is contained in:
cpojer
2026-02-17 15:49:07 +09:00
parent 52ad28e097
commit 048e29ea35
13 changed files with 67 additions and 27 deletions

View File

@@ -39,7 +39,8 @@ describe("cli program (nodes basics)", () => {
it("runs nodes list --connected and filters to connected nodes", async () => {
const now = Date.now();
callGateway.mockImplementation(async (opts: { method?: string }) => {
callGateway.mockImplementation(async (...args: unknown[]) => {
const opts = (args[0] ?? {}) as { method?: string };
if (opts.method === "node.pair.list") {
return {
pending: [],
@@ -81,7 +82,8 @@ describe("cli program (nodes basics)", () => {
it("runs nodes status --last-connected and filters by age", async () => {
const now = Date.now();
callGateway.mockImplementation(async (opts: { method?: string }) => {
callGateway.mockImplementation(async (...args: unknown[]) => {
const opts = (args[0] ?? {}) as { method?: string };
if (opts.method === "node.list") {
return {
ts: now,
@@ -188,7 +190,8 @@ describe("cli program (nodes basics)", () => {
});
it("runs nodes describe and calls node.describe", async () => {
callGateway.mockImplementation(async (opts: { method?: string }) => {
callGateway.mockImplementation(async (...args: unknown[]) => {
const opts = (args[0] ?? {}) as { method?: string };
if (opts.method === "node.list") {
return {
ts: Date.now(),
@@ -254,7 +257,8 @@ describe("cli program (nodes basics)", () => {
});
it("runs nodes invoke and calls node.invoke", async () => {
callGateway.mockImplementation(async (opts: { method?: string }) => {
callGateway.mockImplementation(async (...args: unknown[]) => {
const opts = (args[0] ?? {}) as { method?: string };
if (opts.method === "node.list") {
return {
ts: Date.now(),