Testing.instructions
--- applyTo: "**/*{test,spec}*" description: "Testing guidelines and best practices" --- ## Testing Best Practices ### Test Structure - Follow the Arrange-Act-Assert pattern - Use descriptive test names that explain the behavior - Keep tests focused on a single concern - Group related tests using nested describe blocks ### Test Quality - Write tests that are independent and can run in any order - Use appropriate assertions that provide clear failure messages - Mock external dependencies appropriately - Avoid testing implementation details ### Coverage and Performance - Aim for high test coverage but focus on meaningful tests - Test edge cases and error conditions - Write fast-running unit tests - Use integration tests sparingly for critical paths ### Test Data - Use factories or builders for creating test data - Keep test data minimal and relevant - Use realistic but safe test data - Clean up test data after each test See [project architecture](../context/architecture.context.md) for testing patterns.
fill the variables
This prompt has 1 variable. Pro fills them into a ready-to-paste prompt for you — no manual find-and-replace.
{test,spec}
Unlock with Pro →when to use it
Community prompt sourced from the open-source GitHub repo microsoft/apm (MIT). A "Testing.instructions" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.
tags
roleplaycommunitygeneral
source
microsoft/apm · MIT