Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Commit fd353c2

Browse files
committed
Re-instantiate the client in the loop
1 parent 4c278a3 commit fd353c2

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

agent/src/autoedit.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,12 +496,32 @@ describe('Autoedit', () => {
496496
expect(modifiedLines.length).toBeGreaterThan(0)
497497
expect(unchangedLines.length).toBeGreaterThan(0)
498498
}, 10_000)
499+
})
499500

501+
describe('', () => {
500502
it('Point.cs 2d -> 3d', async () => {
501503
const file = workspace.file('src', 'Point.cs')
502504

503505
for (let i = 0; i < 100; i++) {
504506
console.log(`[my_log] running #${i}`)
507+
508+
const client = TestClient.create({
509+
workspaceRootUri: workspace.rootUri,
510+
name: 'autoedit-aside-custom',
511+
credentials: TESTING_CREDENTIALS.enterprise,
512+
extraConfiguration: {
513+
'cody.suggestions.mode': 'auto-edit',
514+
},
515+
capabilities: {
516+
...allClientCapabilitiesEnabled,
517+
autoedit: 'enabled',
518+
autoeditInlineDiff: 'none',
519+
autoeditAsideDiff: 'diff',
520+
},
521+
})
522+
523+
await client.beforeAll()
524+
505525
const result = await getAutoEditSuggestion(
506526
client,
507527
file,
@@ -549,6 +569,8 @@ describe('Autoedit', () => {
549569
// Check the diff has contents, we don't snapshot this as it is quite a large object
550570
expect(modifiedLines.length).toBeGreaterThan(0)
551571
expect(unchangedLines.length).toBeGreaterThan(0)
572+
573+
await client.afterAll()
552574
}
553575
}, 10_000_000)
554576
})

0 commit comments

Comments
 (0)