Skip to content

Commit 16ee1ad

Browse files
committed
updates
1 parent 6657fe9 commit 16ee1ad

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

.github/instructions/testing-workflow.instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,3 +581,5 @@ envConfig.inspect
581581
- Use `as unknown as TargetType` for type casting instead of `as any` to maintain type safety and avoid 'any' violations
582582
- If tests frequently need private access consider that maybe methods should be protected, or public test utilities should exist for testing (1)
583583
- When making systematic changes across many similar locations, fix one instance completely first to validate the approach before applying the pattern everywhere (1)
584+
- Always recompile tests after making changes before running them, especially when changing imports or type definitions (1)
585+
- When using paths as Map keys for tracking, you MUST use Uri.fsPath consistently throughout the test - mixing hardcoded strings with Uri.fsPath causes key mismatches on Windows (1)

src/test/features/terminalEnvVarInjectorBasic.unit.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ suite('TerminalEnvVarInjector - Core Functionality', () => {
257257
suite('clearWorkspaceVariables', () => {
258258
setup(() => {
259259
injector = new TerminalEnvVarInjector(envVarCollection.object, envVarManager.object);
260+
testableInjector = injector as unknown as TerminalEnvVarInjectorTestable;
260261
});
261262

262263
test('should only delete tracked variables', () => {
@@ -265,7 +266,7 @@ suite('TerminalEnvVarInjector - Core Functionality', () => {
265266
MY_VAR: 'value',
266267
ANOTHER_VAR: 'value2',
267268
};
268-
testableInjector.applyEnvVarChanges(mockScopedCollection, envVars, '/test/workspace');
269+
testableInjector.applyEnvVarChanges(mockScopedCollection, envVars, mockWorkspaceFolder.uri.fsPath);
269270

270271
deleteStub.resetHistory();
271272

@@ -281,7 +282,7 @@ suite('TerminalEnvVarInjector - Core Functionality', () => {
281282
test('should not delete non-tracked variables like BASH_ENV', () => {
282283
// Mock - Set up only one tracked variable
283284
const envVars = { MY_VAR: 'value' };
284-
testableInjector.applyEnvVarChanges(mockScopedCollection, envVars, '/test/workspace');
285+
testableInjector.applyEnvVarChanges(mockScopedCollection, envVars, mockWorkspaceFolder.uri.fsPath);
285286

286287
// Simulate BASH_ENV being set by another manager (not tracked by us)
287288
getStub.withArgs('BASH_ENV').returns({ value: 'some_bash_command' });

0 commit comments

Comments
 (0)