@shopify/jest-koa-mocks
Advanced tools
Comparing version 3.1.5 to 4.0.0
@@ -5,3 +5,2 @@ 'use strict'; | ||
var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js'); | ||
var url = require('url'); | ||
@@ -37,4 +36,3 @@ var stream = require('stream'); | ||
} = options; | ||
const extensions = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, customProperties), {}, { | ||
const extensions = { ...customProperties, | ||
throw: throwFn, | ||
@@ -44,4 +42,3 @@ session, | ||
state | ||
}); | ||
}; | ||
const protocolFallback = encrypted ? 'https' : 'http'; | ||
@@ -54,6 +51,7 @@ const urlObject = new url.URL(url$1, `${protocolFallback}://${host}`); | ||
session, | ||
headers: _rollupPluginBabelHelpers.objectSpread2({ | ||
headers: { | ||
// Koa determines protocol based on the `Host` header. | ||
Host: urlObject.host | ||
}, headers) | ||
Host: urlObject.host, | ||
...headers | ||
} | ||
}); // Some functions we call in the implementations will perform checks for `req.encrypted`, which delegates to the socket. | ||
@@ -60,0 +58,0 @@ // MockRequest doesn't set a fake socket itself, so we create one here. |
{ | ||
"name": "@shopify/jest-koa-mocks", | ||
"version": "3.1.5", | ||
"version": "4.0.0", | ||
"license": "MIT", | ||
@@ -23,3 +23,3 @@ "description": "Utilities to easily stub Koa context and cookies", | ||
"engines": { | ||
"node": ">=12.14.0" | ||
"node": "^14.17.0 || >=16.0.0" | ||
}, | ||
@@ -50,6 +50,5 @@ "dependencies": { | ||
"require": "./index.js" | ||
}, | ||
"./*": "./*" | ||
} | ||
}, | ||
"gitHead": "70feded397084daea784a8c5a523a61ac4fdb34c" | ||
"gitHead": "ef9afc562672dcda9d7800753dc6b777ecd2d751" | ||
} |
Sorry, the diff of this file is not supported yet
23059
31
234