You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Power SEO Bot edited this page Feb 27, 2026
·
1 revision
Testing Guide
Running Tests
# All tests
pnpm test# Watch mode
pnpm test --watch
# Specific package
pnpm --filter @power-seo/schema test# Coverage
pnpm test --coverage
Writing Tests
We use Vitest:
import{describe,it,expect}from'vitest';import{validateTitle}from'@power-seo/core';describe('validateTitle',()=>{it('accepts valid titles',()=>{constresult=validateTitle('My Title');expect(result.valid).toBe(true);});it('rejects titles that are too short',()=>{constresult=validateTitle('Short');expect(result.valid).toBe(false);});});
Test Coverage
Target: 95%+ coverage
View coverage report:
pnpm test --coverage
Integration Tests
Test real-world scenarios:
import{analyzeContent}from'@power-seo/content-analysis';import{auditPage}from'@power-seo/audit';it('produces consistent results across packages',()=>{constcontent=analyzeContent({...});constaudit=auditPage({...});expect(content.score).toBeDefined();expect(audit.score).toBeDefined();});