{"library":"next-test-api-route-handler","type":"library","category":null,"description":"next-test-api-route-handler (NTARH) is a robust utility for confidently unit and integration testing Next.js API routes and handlers. It accurately emulates the Next.js runtime environment, ensuring that `NextRequest` and `NextApiResponse` objects behave as they would in a real Next.js application, including Next.js's patching of the global `fetch` function and correct handling of App Router helper functions like `headers()` and `cookies()`. The current stable version is 5.0.4. The library maintains a rapid release cadence, often issuing updates to ensure compatibility with new Next.js versions, including `canary` releases. Its key differentiator is the deep emulation of Next.js internals, which removes the need for manual mocking with tools like `express` or `node-mocks-http`, and it is automatically tested against various Next.js and Node.js versions.","language":"javascript","status":"active","version":"5.0.4","tags":["javascript","api","route","next","unit","test","endpoint","testing","nextjs"],"install":[{"cmd":"npm install next-test-api-route-handler","imports":["import { test } from 'next-test-api-route-handler';","import { appHandler } from 'next-test-api-route-handler';","import { pagesHandler } from 'next-test-api-route-handler';"]},{"cmd":"yarn add next-test-api-route-handler","imports":[]},{"cmd":"pnpm add next-test-api-route-handler","imports":[]}],"homepage":null,"github":"https://github.com/Xunnamius/next-test-api-route-handler","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/next-test-api-route-handler","openapi_spec":null,"status_page":null,"smithery":null,"compatibility":{"summary":{"python_range":"18–22","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"url":"https://checklist.day/v1/registry/next-test-api-route-handler/compatibility"},"provenance":{"verified_status":null,"verified_at":null,"last_verified":"Wed Jun 17","next_check":"Sat Jul 18","install_tag":null}}