Skip to content

Commit d8f222c

Browse files
committed
refactor: Extend rename to tests added on master
Rebase onto master picked up tools.add_actor.test.ts and three new cases in tools.get_actor_run.response.test.ts that still referenced the old export names. Update them to addActor / getActorRun. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YEYUpGUBagZi4m14YbyJua
1 parent cd91c34 commit d8f222c

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

tests/unit/tools.add_actor.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { describe, expect, it, vi } from 'vitest';
22

33
import { HelperTools } from '../../src/const.js';
4-
import { addTool } from '../../src/tools/actors/add_actor.js';
4+
import { addActor } from '../../src/tools/actors/add_actor.js';
55
import type { HelperTool, InternalToolArgs } from '../../src/types.js';
66
import type { TextToolResult } from './helpers/tool_context.js';
77

@@ -44,12 +44,12 @@ function buildContext(
4444

4545
describe('add-actor tool', () => {
4646
it('has the expected tool name', () => {
47-
expect(addTool.name).toBe(HelperTools.ACTOR_ADD);
47+
expect(addActor.name).toBe(HelperTools.ACTOR_ADD);
4848
});
4949

5050
it('sends list_changed and nudges the client to refresh via tools/list (#851)', async () => {
5151
const sendNotification = vi.fn().mockResolvedValue(undefined);
52-
const result = (await (addTool as HelperTool).call(
52+
const result = (await (addActor as HelperTool).call(
5353
buildContext({ tools: [{ name: 'apify/rag-web-browser' }], sendNotification }),
5454
)) as TextToolResult;
5555

@@ -63,7 +63,7 @@ describe('add-actor tool', () => {
6363
});
6464

6565
it('does not nudge when the actor is already available', async () => {
66-
const result = (await (addTool as HelperTool).call(
66+
const result = (await (addActor as HelperTool).call(
6767
buildContext({ actor: 'apify/already-there', alreadyLoaded: ['apify/already-there'] }),
6868
)) as TextToolResult;
6969

@@ -72,7 +72,7 @@ describe('add-actor tool', () => {
7272
});
7373

7474
it('forwards a load error without a nudge', async () => {
75-
const result = (await (addTool as HelperTool).call(
75+
const result = (await (addActor as HelperTool).call(
7676
buildContext({ errors: [{ message: 'Actor xyz was not found.' }], tools: [] }),
7777
)) as TextToolResult;
7878

tests/unit/tools.get_actor_run.response.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('get-actor-run default response', () => {
146146
// The platform returns inflatedBytes: 0 when it does not yet populate the size; surfacing a
147147
// literal "0 bytes" is misleading for a non-empty dataset, so the field must be omitted.
148148
const run = mockSucceededRun();
149-
const result = await (defaultGetActorRun as HelperTool).call(
149+
const result = await (getActorRun as HelperTool).call(
150150
stubToolCallContext(
151151
{ runId: 'run-1', waitSecs: 0 },
152152
stubClient({ run, dataset: mockDataset({ stats: { writeCount: 47, inflatedBytes: 0 } }) }),
@@ -235,7 +235,7 @@ describe('get-actor-run default response', () => {
235235
}),
236236
} as unknown as InternalToolArgs['apifyClient'];
237237

238-
const result = await (defaultGetActorRun as HelperTool).call(
238+
const result = await (getActorRun as HelperTool).call(
239239
stubToolCallContext({ runId: 'run-1', waitSecs: 0 }, client),
240240
);
241241
const { structuredContent } = result as { structuredContent: RunResponse };
@@ -489,7 +489,7 @@ describe('get-actor-run default response', () => {
489489
}),
490490
} as unknown as InternalToolArgs['apifyClient'];
491491

492-
const result = await (defaultGetActorRun as HelperTool).call(
492+
const result = await (getActorRun as HelperTool).call(
493493
stubToolCallContext({ runId: 'run-1', waitSecs: 0 }, client),
494494
);
495495
const { structuredContent } = result as { structuredContent: RunResponse };

0 commit comments

Comments
 (0)