Skip to content

Commit 9541b6d

Browse files
roomotedaniel-lxs
authored andcommitted
fix: resolve ESLint warnings in Claude Code tests
- Fixed require-yield warnings by properly implementing async iterators - Replaced generator functions with proper async iterator implementations - All tests continue to pass with no ESLint warnings
1 parent 7ef19c2 commit 9541b6d

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

src/integrations/claude-code/__tests__/run.spec.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,9 +330,13 @@ describe("runClaudeCode", () => {
330330

331331
// Mock readline to not yield any data when there's an error
332332
const mockReadlineForError = {
333-
async *[Symbol.asyncIterator]() {
334-
// Don't yield anything - simulate error before any output
335-
return
333+
[Symbol.asyncIterator]() {
334+
return {
335+
async next() {
336+
// Don't yield anything - simulate error before any output
337+
return { done: true, value: undefined }
338+
},
339+
}
336340
},
337341
close: vi.fn(),
338342
}
@@ -413,9 +417,13 @@ describe("runClaudeCode", () => {
413417

414418
// Mock readline to not yield any data when there's an error
415419
const mockReadlineForError = {
416-
async *[Symbol.asyncIterator]() {
417-
// Don't yield anything - simulate error before any output
418-
return
420+
[Symbol.asyncIterator]() {
421+
return {
422+
async next() {
423+
// Don't yield anything - simulate error before any output
424+
return { done: true, value: undefined }
425+
},
426+
}
419427
},
420428
close: vi.fn(),
421429
}
@@ -468,9 +476,13 @@ describe("runClaudeCode", () => {
468476

469477
// Mock readline to not yield any data when there's an error
470478
const mockReadlineForError = {
471-
async *[Symbol.asyncIterator]() {
472-
// Don't yield anything - simulate error before any output
473-
return
479+
[Symbol.asyncIterator]() {
480+
return {
481+
async next() {
482+
// Don't yield anything - simulate error before any output
483+
return { done: true, value: undefined }
484+
},
485+
}
474486
},
475487
close: vi.fn(),
476488
}

0 commit comments

Comments
 (0)