Skip to content

Commit 07aca52

Browse files
committed
updates for better job
1 parent a230490 commit 07aca52

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,5 +585,5 @@ envConfig.inspect
585585
- 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)
586586
- Avoid accessing private members in tests using bracket notation or test interfaces - instead add explicit test helper methods or make methods `protected` rather than `private` for better encapsulation and less brittle tests (1)
587587
- Check for redundant test coverage between unit and integration test files - integration tests should test end-to-end behavior while unit tests focus on internal logic and edge cases (1)
588-
- Replace hardcoded `setTimeout` delays with condition-based polling that waits for the actual expected state - this makes tests faster and more reliable across different CI environments (1)
589-
- Fixture files in `src/test/fixtures/` must be copied to `out/test/fixtures/` for compiled tests to access them - create a copy script or add to the build process (1)
588+
- For async test timing, prefer event-driven or promise-based approaches over delays; when testing fire-and-forget event handlers with no completion signal, use condition-based polling (`waitForCondition`) instead of hardcoded `setTimeout` - faster and more reliable than arbitrary delays (1)
589+
- When accessing fixture files in compiled tests, use `path.join(__dirname, '..', '..', '..', 'src', 'test', 'fixtures')` to read directly from source instead of copying to `out/` - `__dirname` points to the compiled location so navigate up and into `src/` (1)

src/test/features/terminalEnvVarInjector.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ suite('TerminalEnvVarInjector - Integration Tests with Fixtures', () => {
2323
{ replace: sinon.SinonStub; delete: sinon.SinonStub; clear: sinon.SinonStub; get: sinon.SinonStub }
2424
>;
2525

26-
const fixturesPath = path.join(__dirname, '..', 'fixtures', 'terminalEnvVarInjector');
26+
const fixturesPath = path.join(__dirname, '..', '..', '..', 'src', 'test', 'fixtures', 'terminalEnvVarInjector');
2727

2828
setup(async () => {
2929
// Create a unique temp directory for this test run

0 commit comments

Comments
 (0)