{"repo":"Xunnamius/next-test-api-route-handler","free":true,"listed":false,"github":"https://github.com/Xunnamius/next-test-api-route-handler","clone":"git clone https://github.com/Xunnamius/next-test-api-route-handler.git","description":"🔧 Confidently unit and integration test your Next.js API routes/handlers in an isolated Next.js-like environment with buttery-smooth DX","language":"TypeScript","stars":332,"topics":["route-handler","resolver","nextapiresponse","nextapirequest","async","next","next-js","api","route","handler"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"Confidently test your Next.js API routes in an isolated Next-like environment [![Black Lives Matter!][x-badge-blm-image]][x-badge-blm-link] [![Last commit timestamp][x-badge-lastcommit-image]][x-badge-repo-link] [![Codecov][x-badge-codecov-image]][x-badge-codecov-link] [![Source license][x-badge-license-image]][x-badge-license-link] [![Uses Semantic Release!][x-badge-semanticrelease-image]][x-badge-semanticrelease-link] [![NPM version][x-badge-npm-image]][x-badge-npm-link] [![Monthly Downloads][x-badge-downloads-image]][x-badge-downloads-link] next-test-api-route-handler Trying to unit test your Next.js API routes? Tired of hacking something together with express or node-mocks-http or writing a bunch of boring dummy infra just to get some passing tests? And what does a \"passing test\" mean anyway when your handlers aren't receiving actual [ NextRequest ][1] objects and aren't being run by Next.js itself? Next.js patches the global fetch function, for instance. If your tests aren't doing the same, you're making space for bugs! Is it vexing that everything explodes when your [App Router][2] handlers call headers() or cookies() or any of the other route-specific [helper functions][3]? Or maybe you want your [Pages Router][4] handlers to receive actual [ NextApiRequest ][5] and [ NextApiResponse ][5] objects? Sound interesting? Then want no longer! 🤩 [ next-test-api-route-handler ][x-badge-repo-link] (NTARH) uses Next.js's internal resolvers to precisely emulate route handling. T","default_branch":null,"files":null,"tree":[],"storefront":"/r/Xunnamius","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Xunnamius/next-test-api-route-handler/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}