Engineering · Skill
JavaScript Testing Patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
Open in PhởWhat the skill covers
The sections of its instructions, in order.
- 01 When to Use This Skill
- 02 Testing Frameworks
- Jest - Full-Featured Testing Framework
- Vitest - Fast, Vite-Native Testing
- 03 Unit Testing Patterns
- Pattern 1: Testing Pure Functions
- Pattern 2: Testing Classes
- Pattern 3: Testing Async Functions
- 04 Mocking Patterns
- Pattern 1: Mocking Modules
- Pattern 2: Dependency Injection for Testing
- Pattern 3: Spying on Functions
- 05 Integration Testing
- 06 Frontend Testing with Testing Library
- 07 Test Fixtures and Factories
- 08 Best Practices
Reference files
1 file Phở can open while it uses the skill.
- references/advanced-testing-patterns.md
More in JavaScript, TypeScript, Go and Rust
- Modern JavaScript Patterns
Master ES6+ features including async/await, destructuring, spread operators, arrow functions, promises, modules, iterators, generators, and functional programming patterns for…
- TypeScript Advanced Types
Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications. Use when…
- Go Concurrency Patterns
Master Go concurrency with goroutines, channels, sync primitives, and context. Use when building concurrent Go applications, implementing worker pools, or debugging race…
- Memory Safety Patterns
Implement memory-safe programming with RAII, ownership, smart pointers, and resource management across Rust, C++, and C. Use when writing safe systems code, managing resources…
- Rust Async Patterns
Master Rust async programming with Tokio, async traits, error handling, and concurrent patterns. Use when building async Rust applications, implementing concurrent systems, or…
Similar engineering skills
Frequently asked questions
What does JavaScript Testing Patterns do?
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.
Is JavaScript Testing Patterns free to use?
Yes. JavaScript Testing Patterns is published by Seth Hobson under the MIT licence, and you can use it with a free Phở account.
How do I use JavaScript Testing Patterns in Phở?
Press Open in Phở, then Try to apply it to your next message, or add the JavaScript, TypeScript, Go and Rust set so Phở loads it whenever a request matches.
Does JavaScript Testing Patterns need other tools?
No. It works in a normal Phở chat with what you type or upload.
Copied unchanged from wshobson/agents at commit 7e2fb55 and credited to Seth Hobson, who is not affiliated with Phở. The full instructions and licence text ship with the skill inside Phở.