UNPKG

jest-mock-req-res

Version:

Jest mocks for Express Request and Response objects. Inspired by mock-req-res.

31 lines (30 loc) 823 B
/// <reference types="jest" /> import { Response } from 'express'; import { Dictionary } from 'express-serve-static-core'; interface MockResponse extends Response { append: jest.Mock; attachment: jest.Mock; clearCookie: jest.Mock; contentType: jest.Mock; cookie: jest.Mock; download: jest.Mock; end: jest.Mock; format: jest.Mock; get: jest.Mock; header: jest.Mock; json: jest.Mock; jsonp: jest.Mock; links: jest.Mock; location: jest.Mock; redirect: jest.Mock; render: jest.Mock; send: jest.Mock; sendFile: jest.Mock; sendStatus: jest.Mock; set: jest.Mock; status: jest.Mock; type: jest.Mock; vary: jest.Mock; } export declare function mockResponse(options?: Dictionary<any>): MockResponse; export {};