@jest-mock/express
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -15,3 +15,3 @@ "use strict"; | ||
exports.getMockReq = void 0; | ||
exports.getMockReq = (values = {}) => { | ||
const getMockReq = (values = {}) => { | ||
const { params = {}, query = {}, body = {}, cookies = {}, method = '', protocol = '', secure = false, ip = '', ips = [], subdomains = [], path = '', hostname = '', host = '', fresh = false, stale = false, xhr = false, route = {}, signedCookies = {}, originalUrl = '', url = '', baseUrl = '', accepted = [], get = jest.fn().mockName('get mock default'), header = jest.fn().mockName('header mock default'), accepts = jest.fn().mockName('accepts mock default'), acceptsCharsets = jest.fn().mockName('acceptsCharsets mock default'), acceptsEncodings = jest.fn().mockName('acceptsEncodings mock default'), acceptsLanguages = jest.fn().mockName('acceptsLanguages mock default'), range = jest.fn().mockName('range mock default'), param = jest.fn().mockName('param mock default'), is = jest.fn().mockName('is mock default'), app = {}, res = jest.fn().mockName('res mock default'), next = jest.fn().mockName('next mock default'), aborted = false, httpVersion = '', httpVersionMajor = 0, httpVersionMinor = 0, complete = false, connection = {}, socket = {}, headers = {}, rawHeaders = [], trailers = {}, rawTrailers = [], setTimeout = jest.fn().mockName('setTimeout mock default'), statusCode = 0, statusMessage = '', destroy = jest.fn().mockName('destroy mock default') } = values, extraProvidedValues = __rest(values, ["params", "query", "body", "cookies", "method", "protocol", "secure", "ip", "ips", "subdomains", "path", "hostname", "host", "fresh", "stale", "xhr", "route", "signedCookies", "originalUrl", "url", "baseUrl", "accepted", "get", "header", "accepts", "acceptsCharsets", "acceptsEncodings", "acceptsLanguages", "range", "param", "is", "app", "res", "next", "aborted", "httpVersion", "httpVersionMajor", "httpVersionMinor", "complete", "connection", "socket", "headers", "rawHeaders", "trailers", "rawTrailers", "setTimeout", "statusCode", "statusMessage", "destroy"]); | ||
@@ -69,3 +69,4 @@ return Object.assign({ params, | ||
}; | ||
exports.getMockReq = getMockReq; | ||
exports.default = exports.getMockReq; | ||
//# sourceMappingURL=request.js.map |
@@ -19,3 +19,3 @@ "use strict"; | ||
*/ | ||
exports.getMockRes = (values = {}) => { | ||
const getMockRes = (values = {}) => { | ||
const next = jest.fn(); | ||
@@ -114,3 +114,4 @@ const { headersSent = false, locals = {}, charset = '', app = {}, req = {}, statusCode = 0, statusMessage = '', upgrading = false, chunkedEncoding = false, shouldKeepAlive = false, useChunkedEncodingByDefault = false, sendDate = false, finished = false, connection = {}, socket = {} } = values, extraProvidedValues = __rest(values, ["headersSent", "locals", "charset", "app", "req", "statusCode", "statusMessage", "upgrading", "chunkedEncoding", "shouldKeepAlive", "useChunkedEncodingByDefault", "sendDate", "finished", "connection", "socket"]); | ||
}; | ||
exports.getMockRes = getMockRes; | ||
exports.default = exports.getMockRes; | ||
//# sourceMappingURL=response.js.map |
{ | ||
"name": "@jest-mock/express", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "A lightweight Jest mock for unit testing Express", | ||
@@ -44,14 +44,14 @@ "main": "dist/index.js", | ||
"@types/express": "^4.17.9", | ||
"@types/jest": "^26.0.15", | ||
"@typescript-eslint/eslint-plugin": "^4.8.1", | ||
"@typescript-eslint/parser": "^4.8.1", | ||
"@types/jest": "^26.0.19", | ||
"@typescript-eslint/eslint-plugin": "^4.9.1", | ||
"@typescript-eslint/parser": "^4.9.1", | ||
"coveralls": "^3.0.7", | ||
"eslint": "^7.13.0", | ||
"eslint-config-prettier": "^6.15.0", | ||
"eslint-plugin-prettier": "^3.1.1", | ||
"eslint": "^7.15.0", | ||
"eslint-config-prettier": "^7.0.0", | ||
"eslint-plugin-prettier": "^3.2.0", | ||
"jest": "^26.6.3", | ||
"prettier": "^2.1.2", | ||
"snyk": "^1.428.0", | ||
"prettier": "^2.2.1", | ||
"snyk": "^1.436.0", | ||
"ts-jest": "^26.4.4", | ||
"typescript": "^4.0.5" | ||
"typescript": "^4.1.3" | ||
}, | ||
@@ -58,0 +58,0 @@ "dependencies": {}, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
342943
2209