Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita57d676

Browse files
jaggederestclaude
andcommitted
fix: address ESLint errors in api.test.ts
- Add eslint-disable comment for @typescript-eslint/no-explicit-any- Add optional chaining for ProxyAgent mock access to prevent undefined errors- Ensure tests continue to pass with stricter type checking🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parentf8b6dbb commita57d676

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/api.test.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/no-explicit-any */
12
import{spawn}from"child_process";
23
import{Api}from"coder/site/src/api/api";
34
import{EventEmitter}from"events";
@@ -262,11 +263,13 @@ describe("api", () => {
262263

263264
awaitcreateHttpAgent();
264265

265-
constproxyAgentCall=vi.mocked(ProxyAgent).mock.calls[0][0];
266-
constgetProxyForUrlFn=proxyAgentCall.getProxyForUrl;
266+
constproxyAgentCall=vi.mocked(ProxyAgent).mock.calls[0]?.[0];
267+
constgetProxyForUrlFn=proxyAgentCall?.getProxyForUrl;
267268

268269
// Test the getProxyForUrl callback
269-
getProxyForUrlFn("https://example.com");
270+
if(getProxyForUrlFn){
271+
getProxyForUrlFn("https://example.com");
272+
}
270273

271274
expect(vi.mocked(getProxyForUrl)).toHaveBeenCalledWith(
272275
"https://example.com",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp