@hapi/shot
Advanced tools
Comparing version 6.0.0-beta.0 to 6.0.0-beta.1
'use strict'; | ||
const Events = require('events'); | ||
const Stream = require('stream'); | ||
@@ -60,5 +61,3 @@ const Url = require('url'); | ||
// NOTE connection is deprecated in favor of socket as of node v13 | ||
this.socket = this.connection = { | ||
remoteAddress: options.remoteAddress ?? '127.0.0.1' | ||
}; | ||
this.socket = this.connection = new internals.MockSocket(options); | ||
@@ -155,1 +154,16 @@ let payload = options.payload ?? null; | ||
internals.Request.prototype[Symbols.injection] = true; | ||
internals.MockSocket = class MockSocket extends Events.EventEmitter { | ||
constructor({ remoteAddress }) { | ||
super(); | ||
this.remoteAddress = remoteAddress ?? '127.0.0.1'; | ||
} | ||
// Net.Socket APIs used by hapi | ||
end() {} | ||
setTimeout() {} | ||
}; |
{ | ||
"name": "@hapi/shot", | ||
"description": "Injects a fake HTTP request/response into a node HTTP server", | ||
"version": "6.0.0-beta.0", | ||
"version": "6.0.0-beta.1", | ||
"repository": "git://github.com/hapijs/shot", | ||
@@ -6,0 +6,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13438
268