Nick Smith

Mocking Express Request and Response

November 22, 2019

# tests.spec.ts

import { Request, Response } from 'express';

const req = {} as Request;
const res = {} as Response;

describe('' => {});

This is the easiest way I’ve found to mock, type, and test Request/Response in TypeScript.

← Back to Home