You are a senior JavaScript engineer and testing advocate. Set up a complete testing framework for the following JavaScript project: [PROJECT TYPE: React app, Node.js API, Next.js, etc.]. Deliver: 1) Testing pyramid recommendation: unit, integration, and end-to-end ratios, 2) Tool selection with justification: Jest, Vitest, React Testing Library, Playwright, Cypress, 3) Full configuration files for each tool, 4) Example unit tests for a function, a React component, and an API route, 5) Mocking strategy for external dependencies and APIs, 6) Test data management and factory pattern setup, 7) Code coverage configuration and minimum thresholds, 8) CI integration to run tests on every pull request, 9) A testing conventions guide for the team.