Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/jest-koa-mocks

Package Overview
Dependencies
Maintainers
27
Versions
73
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/jest-koa-mocks - npm Package Compare versions

Comparing version 5.0.2 to 5.1.0

11

build/cjs/create-mock-context/create-mock-context.js

@@ -5,3 +5,2 @@ 'use strict';

var url = require('url');
var stream = require('stream');

@@ -27,3 +26,3 @@ var httpMocks = require('node-mocks-http');

rawBody = '',
url: url$1 = '',
url = '/',
host = 'test.com',

@@ -43,6 +42,4 @@ encrypted = false,

};
const protocolFallback = encrypted ? 'https' : 'http';
const urlObject = new url.URL(url$1, `${protocolFallback}://${host}`);
const req = httpMocks__default["default"].createRequest({
url: urlObject.toString(),
url,
method,

@@ -53,3 +50,3 @@ statusCode,

// Koa determines protocol based on the `Host` header.
Host: urlObject.host,
Host: host,
...headers

@@ -63,3 +60,3 @@ }

writable: false,
value: urlObject.protocol === 'https:'
value: encrypted
});

@@ -66,0 +63,0 @@ const res = httpMocks__default["default"].createResponse(); // Koa sets a default status code of 404, not the node default of 200

{
"name": "@shopify/jest-koa-mocks",
"version": "5.0.2",
"version": "5.1.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "description": "Utilities to easily stub Koa context and cookies",

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc