@shopify/jest-koa-mocks
Advanced tools
Comparing version 3.0.6 to 3.0.7
@@ -19,3 +19,3 @@ 'use strict'; | ||
function createContext(options = {}) { | ||
const app = new Koa__default['default'](); | ||
const app = new Koa__default["default"](); | ||
const { | ||
@@ -47,3 +47,3 @@ cookies, | ||
const urlObject = new url.URL(url$1, `${protocolFallback}://${host}`); | ||
const req = httpMocks__default['default'].createRequest({ | ||
const req = httpMocks__default["default"].createRequest({ | ||
url: urlObject.toString(), | ||
@@ -60,3 +60,3 @@ method, | ||
req.socket = new stream__default['default'].Duplex(); | ||
req.socket = new stream__default["default"].Duplex(); | ||
Object.defineProperty(req.socket, 'encrypted', { | ||
@@ -66,3 +66,3 @@ writable: false, | ||
}); | ||
const res = httpMocks__default['default'].createResponse(); // Koa sets a default status code of 404, not the node default of 200 | ||
const res = httpMocks__default["default"].createResponse(); // Koa sets a default status code of 404, not the node default of 200 | ||
// https://github.com/koajs/koa/blob/master/docs/api/response.md#responsestatus | ||
@@ -76,3 +76,3 @@ | ||
Object.assign(context, extensions); | ||
context.cookies = createMockCookies['default'](cookies); // ctx.request.body is a common enough custom property for middleware to add that it's handy to just support it by default | ||
context.cookies = createMockCookies["default"](cookies); // ctx.request.body is a common enough custom property for middleware to add that it's handy to just support it by default | ||
@@ -87,2 +87,2 @@ context.request.body = requestBody; | ||
exports.default = createContext; | ||
exports["default"] = createContext; |
@@ -9,2 +9,2 @@ 'use strict'; | ||
exports.default = createMockContext['default']; | ||
exports["default"] = createMockContext["default"]; |
@@ -22,2 +22,2 @@ 'use strict'; | ||
exports.default = createMockCookies; | ||
exports["default"] = createMockCookies; |
@@ -9,2 +9,2 @@ 'use strict'; | ||
exports.default = createMockCookies['default']; | ||
exports["default"] = createMockCookies["default"]; |
@@ -10,3 +10,3 @@ 'use strict'; | ||
exports.createMockContext = createMockContext['default']; | ||
exports.createMockCookies = createMockCookies['default']; | ||
exports.createMockContext = createMockContext["default"]; | ||
exports.createMockCookies = createMockCookies["default"]; |
{ | ||
"name": "@shopify/jest-koa-mocks", | ||
"version": "3.0.6", | ||
"version": "3.0.7", | ||
"license": "MIT", | ||
@@ -52,3 +52,3 @@ "description": "Utilities to easily stub Koa context and cookies", | ||
}, | ||
"gitHead": "e706481f46b38705389d37e09caf3450630ab0ba" | ||
"gitHead": "9cc43c40f1cf55b3292a6c397c331cfdfd9f83d2" | ||
} |
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
Sorry, the diff of this file is not supported yet
26375