stoppable
Advanced tools
Comparing version 1.0.4 to 1.0.5
{ | ||
"name": "stoppable", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"engines": { | ||
"node": ">=7.6.0" | ||
"node": ">=6" | ||
}, | ||
"keywords": [], | ||
"repository": "hunterloftis/stoppable", | ||
"scripts": { | ||
@@ -22,2 +23,3 @@ "lint": "standard --fix 'lib/**/*.js'", | ||
"artillery": "^1.6.0-2", | ||
"awaiting": "^2.2.0", | ||
"chai": "^3.5.0", | ||
@@ -30,6 +32,3 @@ "documentation": "^4.0.0-rc.1", | ||
"standard": "^8.6.0" | ||
}, | ||
"dependencies": { | ||
"awaiting": "^2.2.0" | ||
} | ||
} |
@@ -53,20 +53,18 @@ const http = require('http') | ||
describe('without keep-alive connections', () => { | ||
describe('without keep-alive connections', () => { | ||
let closed = 0 | ||
it('stops accepting new connections', async () => { | ||
const server = stoppable(http.createServer((req, res) => res.end('hello'))) | ||
server.on('close', () => closed++) | ||
server.listen(8000) | ||
await a.event(server, 'listening') | ||
const res1 = await request('http://localhost:8000').agent(new http.Agent()) | ||
const text1 = await res1.text() | ||
assert.equal(text1, 'hello') | ||
server.stop() | ||
const err = await a.failure(request('http://localhost:8000').agent(new http.Agent())) | ||
assert.match(err.message, /ECONNREFUSED/) | ||
}) | ||
it('closes', () => { | ||
assert.equal(closed, 1) | ||
}) | ||
let closed = 0 | ||
it('stops accepting new connections', async () => { | ||
const server = stoppable(http.createServer((req, res) => res.end('hello'))) | ||
server.on('close', () => closed++) | ||
server.listen(8000) | ||
await a.event(server, 'listening') | ||
const res1 = await request('http://localhost:8000').agent(new http.Agent()) | ||
const text1 = await res1.text() | ||
assert.equal(text1, 'hello') | ||
server.stop() | ||
const err = await a.failure(request('http://localhost:8000').agent(new http.Agent())) | ||
assert.match(err.message, /ECONNREFUSED/) | ||
}) | ||
it('closes', () => { | ||
assert.equal(closed, 1) | ||
}) | ||
}) | ||
@@ -73,0 +71,0 @@ describe('with keep-alive connections', () => { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
0
2
0
1
202582
9
10
261
6
- Removedawaiting@^2.2.0
- Removedawaiting@2.2.0(transitive)