Menu Close
In fact, it has the 39mm Oystersteel monobloc middle-case of the OP essentially, which appears a little more curvaceous than the flat, trapezoid profile of the 40mm Oystersteel Submariner. The bezel of the replica rolex watches Explorer I is different on each: The OP has a domed, high-polish bezel, while the Explorer I has what Rolex calls a "Smooth" bezel. It has a flat surface instead of the convex bezel of the OP, with nicely polished.

next-testing

NextJS Testing Framework

npm (tag)
NPM
npm

Maintainability Rating
Reliability Rating
Coverage

Simplifying the struggle of mocking and reimplementing NextAPIRequests and NextAPIResponses
in order to test and validate NextJS serverless functions.

Installation

Choose your favorite package manager to install the next-testing library

NPM

npm install --save-dev @next-testing/api

Yarn

yarn add -D @next-testing/api

PNPM

pnpm add -D @next-testing/api

Usage

Mocking Simple GET Request

import ServerlessFunctionApi from './pages/api/v1/myApi' import { NextApiRequestBuilder, ResponseMock } from '@next-testing/api' test("Get Request and Response Mock", () => { const req = new NextApiRequestBuilder().setMethod('GET').build() const res = ResponseMock<MyResult>() ServerlessFunctionApi(req, res) expect(res.getStatusCode()).toEqual(405) expect(res.getBodyJson()).toStrictEqual({ success: false, message: 'Method not allowed', }) })

Mocking Simple POST Request

import ServerlessFunctionApi from './pages/api/v1/myApi' import { NextApiRequestBuilder, ResponseMock } from '@next-testing/api' it('Post Request and Response Mock', async () => { const req = new NextApiRequestBuilder().setMethod('POST').build() const res = ResponseMock<MyResult>() ServerlessFunctionApi(req, res) expect(res.getStatusCode()).toEqual(401) expect(res.getBodyJson()).toStrictEqual({ success: false, message: 'access denied', }) })

Mocking Request with Headers

import ServerlessFunctionApi from './pages/api/v1/myApi' import { NextApiRequestBuilder, ResponseMock } from '@next-testing/api' it('Mock Request and Response with headers', async () => { const req = new NextApiRequestBuilder() .setMethod('POST') .setHeaders({ authorization: 'Bearer ABC123' }) .build() const res = ResponseMock<CronResult>() ServerlessFunctionApi(req, res) expect(res.getStatusCode()).toEqual(401) expect(res.getBodyJson()).toStrictEqual({ success: false, message: 'access denied', }) })

Mocking Request with Headers, Body & Cookies

import ServerlessFunctionApi from './pages/api/v1/myApi' import { NextApiRequestBuilder, ResponseMock } from '@next-testing/api' it('Mock Request and Response with headers', async () => { const req = new NextApiRequestBuilder() .setMethod('POST') .setHeaders({ authorization: 'Bearer ABC123' }) .setCookies({ apiKey: "mytoken" }) .setBody({ posts: [{ content: "hello world" }] }) .build() const res = ResponseMock<CronResult>() ServerlessFunctionApi(req, res) expect(res.getStatusCode()).toEqual(401) expect(res.getBodyJson()).toStrictEqual({ success: false, message: 'access denied', }) })
View Source Code