Skip to content

Commit ea1bca3

Browse files
committed
update with learnings
1 parent e7083cf commit ea1bca3

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,3 +569,5 @@ envConfig.inspect
569569
- Create minimal mock objects with only required methods and use TypeScript type assertions (e.g., mockApi as PythonEnvironmentApi) to satisfy interface requirements instead of implementing all interface methods when only specific methods are needed for the test (1)
570570
- When reviewing existing tests, focus on behavior rather than implementation details in test names and assertions - transform "should return X when Y" into "should [expected behavior] when [scenario context]" (1)
571571
- Simplify mock setup by only mocking methods actually used in tests and use `as unknown as Type` for TypeScript compatibility (1)
572+
- Avoid setting global default stub behaviors in setup() that require resetBehavior() calls; instead configure stub behaviors conditionally in each test to prevent conflicts and make tests self-contained (1)
573+
- Use conditional stub configuration with withArgs() instead of multiple resolves() calls to prevent Sinon behavior conflicts - if you must override a stub, call resetBehavior() first to clear previous configurations (1)

0 commit comments

Comments
 (0)