Socket
Socket
Sign inDemoInstall

create-test-server

Package Overview
Dependencies
74
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.1.0

6

package.json
{
"name": "create-test-server",
"version": "2.0.2",
"version": "2.1.0",
"description": "Creates a minimal Express server for testing",

@@ -44,4 +44,4 @@ "main": "src/index.js",

"devDependencies": {
"ava": "^0.20.0",
"coveralls": "^2.13.1",
"ava": "^0.22.0",
"coveralls": "^3.0.0",
"eslint-config-xo-lukechilds": "^1.0.0",

@@ -48,0 +48,0 @@ "got": "^7.0.0",

@@ -21,6 +21,8 @@ 'use strict';

pify(server.listen.bind(server))().then(() => {
app.url = `http://localhost:${server.address().port}`;
app.port = server.address().port;
app.url = `http://localhost:${app.port}`;
}),
pify(sslServer.listen.bind(sslServer))().then(() => {
app.sslUrl = `https://localhost:${sslServer.address().port}`;
app.sslPort = sslServer.address().port;
app.sslUrl = `https://localhost:${app.sslPort}`;
})

@@ -31,5 +33,7 @@ ]);

pify(server.close.bind(server))().then(() => {
app.port = undefined;
app.url = undefined;
}),
pify(sslServer.close.bind(sslServer))().then(() => {
app.sslPort = undefined;
app.sslUrl = undefined;

@@ -36,0 +40,0 @@ })

@@ -16,2 +16,4 @@ import test from 'ava';

t.true(typeof server.port === 'number');
t.true(typeof server.sslPort === 'number');
t.true(typeof server.url === 'string');

@@ -62,7 +64,7 @@ t.true(typeof server.sslUrl === 'string');

const server = await createTestServer();
const origurl = server.url;
const origPort = server.port;
await server.close();
await server.listen();
t.not(origurl, server.url);
t.not(origPort, server.port);
});

@@ -69,0 +71,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc