Open
Conversation
SkyZeroZx
reviewed
Feb 12, 2026
atscott
reviewed
Feb 12, 2026
Add testing tips to AGENTS.md
atscott
reviewed
Feb 12, 2026
atscott
requested changes
Feb 13, 2026
Contributor
atscott
left a comment
There was a problem hiding this comment.
I tested this out by converting the contents of packages/core/test/acceptance/control_flow_for_spec.ts to an outline, then asking gemini to create the tests. It stuck to the old detectChanges style and I asked why and iterated on the agents file from there. I think this gave better outcomes:
## Testing
- **Zoneless & Async-First:** Assume a zoneless environment where state changes schedule updates asynchronously.
- **Do NOT** use `fixture.detectChanges()` to manually trigger updates.
- **ALWAYS** use the "Act, Wait, Assert" pattern:
1. **Act:** Update state or perform an action.
2. **Wait:** `await fixture.whenStable()` to allow the framework to process the scheduled update.
3. **Assert:** Verify the output.
- To keep tests fast, minimize the need for waiting:
- Use `useAutoTick()` (from `packages/private/testing/src/utils.ts`) to fast-forward time via the mock clock.
- When waiting is necessary, use real async tests (`it('...', async () => { ... })`) along with:
- `await timeout(ms)` (from `packages/private/testing/src/utils.ts`) to wait a specific number of milliseconds.
- `await fixture.whenStable()` to wait for framework stability.
I do think this misses the nuance of whenStable not working in all scenarios but that is probably fine for most use-cases.
Contributor
Author
|
yeah I also found it difficult to get it away from |
Co-authored-by: Joey Perrott <josephperrott@gmail.com>
Member
|
@atscott This is still in a state of "requested changes" but Miles added the merge label. Are your requests required to merge? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Add testing tips to AGENTS.md