@jest-mock/express
Advanced tools
Comparing version
@@ -6,4 +6,4 @@ import { Response, NextFunction } from 'express'; | ||
*/ | ||
export declare const getMockRes: <T extends Response>() => { | ||
res: T; | ||
export declare const getMockRes: () => { | ||
res: Response; | ||
next: NextFunction; | ||
@@ -10,0 +10,0 @@ mockClear: () => void; |
@@ -66,25 +66,25 @@ "use strict"; | ||
next(); | ||
res.status(); | ||
res.sendStatus(); | ||
res.links(); | ||
res.status(123); | ||
res.sendStatus(123); | ||
res.links({}); | ||
res.send(); | ||
res.json(); | ||
res.jsonp(); | ||
res.sendFile(); | ||
res.sendfile(); | ||
res.download(); | ||
res.contentType(); | ||
res.type(); | ||
res.format(); | ||
res.sendFile('test'); | ||
res.sendfile('test'); | ||
res.download('test'); | ||
res.contentType('test'); | ||
res.type('test'); | ||
res.format({}); | ||
res.attachment(); | ||
res.set(); | ||
res.header(); | ||
res.get(); | ||
res.clearCookie(); | ||
res.cookie(); | ||
res.location(); | ||
res.redirect(); | ||
res.render(); | ||
res.vary(); | ||
res.append(); | ||
res.set({}); | ||
res.header({}); | ||
res.get('test'); | ||
res.clearCookie('test'); | ||
res.cookie('test', 'test'); | ||
res.location('test'); | ||
res.redirect('test'); | ||
res.render('test'); | ||
res.vary('test'); | ||
res.append('test'); | ||
// ensure they all report as being called | ||
@@ -148,25 +148,25 @@ expect(next.mock.calls.length).toBe(1); | ||
next(); | ||
res.status(); | ||
res.sendStatus(); | ||
res.links(); | ||
res.status(123); | ||
res.sendStatus(123); | ||
res.links({}); | ||
res.send(); | ||
res.json(); | ||
res.jsonp(); | ||
res.sendFile(); | ||
res.sendfile(); | ||
res.download(); | ||
res.contentType(); | ||
res.type(); | ||
res.format(); | ||
res.sendFile('test'); | ||
res.sendfile('test'); | ||
res.download('test'); | ||
res.contentType('test'); | ||
res.type('test'); | ||
res.format({}); | ||
res.attachment(); | ||
res.set(); | ||
res.header(); | ||
res.get(); | ||
res.clearCookie(); | ||
res.cookie(); | ||
res.location(); | ||
res.redirect(); | ||
res.render(); | ||
res.vary(); | ||
res.append(); | ||
res.set({}); | ||
res.header({}); | ||
res.get('test'); | ||
res.clearCookie('test'); | ||
res.cookie('test', 'test'); | ||
res.location('test'); | ||
res.redirect('test'); | ||
res.render('test'); | ||
res.vary('test'); | ||
res.append('test'); | ||
// ensure they all report as being called | ||
@@ -173,0 +173,0 @@ expect(next.mock.calls.length).toBe(1); |
{ | ||
"name": "@jest-mock/express", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "A lightweight Jest mock for unit testing Express", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -72,25 +72,25 @@ // Tested Module | ||
next() | ||
res.status() | ||
res.sendStatus() | ||
res.links() | ||
res.status(123) | ||
res.sendStatus(123) | ||
res.links({}) | ||
res.send() | ||
res.json() | ||
res.jsonp() | ||
res.sendFile() | ||
res.sendfile() | ||
res.download() | ||
res.contentType() | ||
res.type() | ||
res.format() | ||
res.sendFile('test') | ||
res.sendfile('test') | ||
res.download('test') | ||
res.contentType('test') | ||
res.type('test') | ||
res.format({}) | ||
res.attachment() | ||
res.set() | ||
res.header() | ||
res.get() | ||
res.clearCookie() | ||
res.cookie() | ||
res.location() | ||
res.redirect() | ||
res.render() | ||
res.vary() | ||
res.append() | ||
res.set({}) | ||
res.header({}) | ||
res.get('test') | ||
res.clearCookie('test') | ||
res.cookie('test', 'test') | ||
res.location('test') | ||
res.redirect('test') | ||
res.render('test') | ||
res.vary('test') | ||
res.append('test') | ||
@@ -159,25 +159,25 @@ // ensure they all report as being called | ||
next() | ||
res.status() | ||
res.sendStatus() | ||
res.links() | ||
res.status(123) | ||
res.sendStatus(123) | ||
res.links({}) | ||
res.send() | ||
res.json() | ||
res.jsonp() | ||
res.sendFile() | ||
res.sendfile() | ||
res.download() | ||
res.contentType() | ||
res.type() | ||
res.format() | ||
res.sendFile('test') | ||
res.sendfile('test') | ||
res.download('test') | ||
res.contentType('test') | ||
res.type('test') | ||
res.format({}) | ||
res.attachment() | ||
res.set() | ||
res.header() | ||
res.get() | ||
res.clearCookie() | ||
res.cookie() | ||
res.location() | ||
res.redirect() | ||
res.render() | ||
res.vary() | ||
res.append() | ||
res.set({}) | ||
res.header({}) | ||
res.get('test') | ||
res.clearCookie('test') | ||
res.cookie('test', 'test') | ||
res.location('test') | ||
res.redirect('test') | ||
res.render('test') | ||
res.vary('test') | ||
res.append('test') | ||
@@ -184,0 +184,0 @@ // ensure they all report as being called |
@@ -8,4 +8,4 @@ // Libraries | ||
*/ | ||
export const getMockRes = <T extends Response>(): { | ||
res: T | ||
export const getMockRes = (): { | ||
res: Response | ||
next: NextFunction | ||
@@ -102,3 +102,3 @@ mockClear: () => void | ||
return { | ||
res: (response as unknown) as T, | ||
res: (response as unknown) as Response, | ||
next: next as NextFunction, | ||
@@ -105,0 +105,0 @@ mockClear: clearAllMocks, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
80192
1.01%