Skip to content

Commit 5071ff8

Browse files
committed
fix tests
1 parent 07aca52 commit 5071ff8

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/test/features/terminalEnvVarInjector.test.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -319,12 +319,12 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
319319
uri: workspaceFolder.uri,
320320
changeType: FileChangeType.Changed,
321321
});
322-
await waitForCondition(() => stubs.delete.calledWith('BAR'));
322+
await waitForCondition(() => stubs!.delete.calledWith('BAR'));
323323

324324
// Assert - BAR should be deleted
325-
assert.ok(stubs.delete.calledWith('BAR'), 'Should delete commented out BAR');
326-
assert.ok(stubs.replace.calledWith('FOO', 'bar'), 'Should keep FOO');
327-
assert.ok(stubs.replace.calledWith('BAZ', 'qux'), 'Should keep BAZ');
325+
assert.ok(stubs!.delete.calledWith('BAR'), 'Should delete commented out BAR');
326+
assert.ok(stubs!.replace.calledWith('FOO', 'bar'), 'Should keep FOO');
327+
assert.ok(stubs!.replace.calledWith('BAZ', 'qux'), 'Should keep BAZ');
328328
});
329329

330330
test('Scenario: Adding a new variable injects it', async () => {
@@ -348,6 +348,7 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
348348
let stubs = scopedCollectionStubs.get(workspaceDir);
349349
await waitForCondition(() => !!stubs && stubs!.replace.calledWith('FOO', 'bar'));
350350
stubs = scopedCollectionStubs.get(workspaceDir)!;
351+
stubs = scopedCollectionStubs.get(workspaceDir)!;
351352

352353
// Act - Add NEW_VAR to file
353354
await fs.appendFile(envFilePath, 'NEW_VAR=new_value\n');
@@ -358,11 +359,11 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
358359
uri: workspaceFolder.uri,
359360
changeType: FileChangeType.Changed,
360361
});
361-
await waitForCondition(() => stubs.replace.calledWith('NEW_VAR', 'new_value'));
362+
await waitForCondition(() => stubs!.replace.calledWith('NEW_VAR', 'new_value'));
362363

363364
// Assert
364-
assert.ok(stubs.replace.calledWith('NEW_VAR', 'new_value'), 'Should add NEW_VAR');
365-
assert.ok(stubs.replace.calledWith('FOO', 'bar'), 'Should keep FOO');
365+
assert.ok(stubs!.replace.calledWith('NEW_VAR', 'new_value'), 'Should add NEW_VAR');
366+
assert.ok(stubs!.replace.calledWith('FOO', 'bar'), 'Should keep FOO');
366367
});
367368

368369
test('Scenario: Unsetting a variable (VAR=) removes it', async () => {
@@ -386,6 +387,7 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
386387
let stubs = scopedCollectionStubs.get(workspaceDir);
387388
await waitForCondition(() => !!stubs && stubs!.replace.calledWith('TO_UNSET', 'value'));
388389
stubs = scopedCollectionStubs.get(workspaceDir)!;
390+
stubs = scopedCollectionStubs.get(workspaceDir)!;
389391

390392
assert.ok(stubs.replace.calledWith('TO_UNSET', 'value'), 'TO_UNSET should be initially set');
391393

@@ -398,10 +400,10 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
398400
uri: workspaceFolder.uri,
399401
changeType: FileChangeType.Changed,
400402
});
401-
await waitForCondition(() => stubs.delete.calledWith('TO_UNSET'));
403+
await waitForCondition(() => stubs!.delete.calledWith('TO_UNSET'));
402404

403405
// Assert
404-
assert.ok(stubs.delete.calledWith('TO_UNSET'), 'Should delete unset variable');
406+
assert.ok(stubs!.delete.calledWith('TO_UNSET'), 'Should delete unset variable');
405407
});
406408
});
407409

0 commit comments

Comments
 (0)