Test every facet of your features
Write requirements naturally. Know what's tested. Track multi-stakeholder coverage automatically.
Traditional testing asks "what did developers test?" Facet asks "what do stakeholders need, and is it tested?"
Real products serve multiple stakeholders—product owners, compliance teams, UX designers, security architects—each with their own requirements. Facet lets every stakeholder write requirements in natural language, then tracks whether tests actually cover them.
One feature. Many facets. All tracked.
bun add -d @facet-coverage/coreBusiness Team — facets/business.md
## Guest Purchase Flow
Users should complete purchases without creating an account.Compliance Team — facets/compliance.md
## PCI-DSS Payment Requirements
1. **Encryption in transit** [](#tls) - TLS 1.2+ required
2. **No CVV storage** [](#cvv) - Never store CVV
3. **Card masking** [](#masking) - Show only last 4 digitsUX Team — facets/ux.md
## Mobile Checkout Experience
Large touch targets (44px min), single column layout, inline validation.import { Facets, facet } from '../.facet/facets';
test('guest user completes purchase on mobile', () => {
// This test proves requirements for 3 different stakeholders
facet(Facets.BUSINESS_GUEST_PURCHASE_FLOW);
facet(Facets.COMPLIANCE_PCI_DSS);
facet(Facets.UX_MOBILE_CHECKOUT_EXPERIENCE);
const order = checkout(cart, 'user@example.com', '4242424242424242');
expect(order.confirmed).toBe(true);
expect(order.maskedCard).toBe('•••• 4242'); // PCI-DSS compliance
});
test('TLS encryption enforced', () => {
// Track specific compliance sub-requirements
facet(Facets.COMPLIANCE_PCI_DSS__TLS);
expect(paymentEndpoint.protocol).toBe('https');
});bunx facet analyzeFacet Coverage Report
Overall: 83% (5/6)
business: 100% (1/1) ✓
compliance: 80% (4/5)
✗ pci-dss/cvv - No CVV storage
ux: 100% (1/1) ✓
Now you know: The compliance team's CVV requirement isn't tested yet.
| Guide | Description |
|---|---|
| Getting Started | Full quickstart with project structure |
| Core Concepts | What Facet is and how it works |
| Configuration | Config options and examples |
| CLI Reference | All available commands |
| Playwright Integration | Enhanced Playwright support |
| Programmatic API | Use Facet in code |
| ID Patterns | Stable IDs, sub-facets, and nested features |
| Document | Description |
|---|---|
| Vision | Philosophy behind multi-stakeholder coverage |
| Testing Phases | Where Facet fits in testing |
| Comparisons | How Facet differs from BDD, Cucumber, etc. |
- Natural language - Write requirements as Markdown, no Gherkin syntax
- Multi-perspective - Business, compliance, UX, technical facets per feature
- Sub-facets - Track fine-grained requirements with hierarchical IDs
- Type-safe linking - Generated TypeScript types prevent broken references
- Framework agnostic - Works with Jest, Vitest, Playwright, Mocha, Bun
- Gap detection - See what's untested across all stakeholder perspectives
- Live dashboard -
facet servefor real-time coverage with hot reload - CI-ready - Threshold enforcement and JSON output for pipelines
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes
- Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - see the LICENSE file for details.