drop node 4 from travis and update dependencies

This commit is contained in:
shimks 2018-06-07 12:26:52 -04:00
parent 3ec47f84fd
commit 56d26b377e
4 changed files with 28 additions and 15 deletions

View File

@ -1,6 +1,6 @@
sudo: false sudo: false
language: node_js language: node_js
node_js: node_js:
- "4"
- "6" - "6"
- "7" - "8"
- "10"

View File

@ -12,6 +12,14 @@ In production mode, `strong-error-handler` omits details from error responses to
In debug mode, `strong-error-handler` returns full error stack traces and internal details of any error objects to the client in the HTTP responses. In debug mode, `strong-error-handler` returns full error stack traces and internal details of any error objects to the client in the HTTP responses.
## Supported versions
Current|Long Term Support|Maintenance
:-:|:-:|:-:
3.x|2.x|1.x
Learn more about our LTS plan in [docs](http://loopback.io/doc/en/contrib/Long-term-support.html).
## Installation ## Installation
```bash ```bash

View File

@ -4,7 +4,7 @@
"license": "MIT", "license": "MIT",
"version": "2.3.2", "version": "2.3.2",
"engines": { "engines": {
"node": ">=4" "node": ">=6"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -18,19 +18,19 @@
}, },
"dependencies": { "dependencies": {
"accepts": "^1.3.3", "accepts": "^1.3.3",
"debug": "^2.2.0", "debug": "^3.1.0",
"ejs": "^2.5.7", "ejs": "^2.6.1",
"http-status": "^1.0.0", "http-status": "^1.1.2",
"js2xmlparser": "^3.0.0", "js2xmlparser": "^3.0.0",
"strong-globalize": "^3.1.0" "strong-globalize": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"chai": "^3.5.0", "chai": "^4.1.2",
"eslint": "^3.14.1", "eslint": "^4.19.1",
"eslint-config-loopback": "^8.0.0", "eslint-config-loopback": "^10.0.0",
"express": "^4.13.4", "express": "^4.16.3",
"mocha": "^3.2.0", "mocha": "^5.2.0",
"supertest": "^3.0.0" "supertest": "^3.1.0"
}, },
"browser": { "browser": {
"strong-error-handler": false "strong-error-handler": false

View File

@ -16,6 +16,7 @@ var util = require('util');
describe('strong-error-handler', function() { describe('strong-error-handler', function() {
before(setupHttpServerAndClient); before(setupHttpServerAndClient);
beforeEach(resetRequestHandler); beforeEach(resetRequestHandler);
after(stopHttpServerAndClient);
it('sets nosniff header', function(done) { it('sets nosniff header', function(done) {
givenErrorHandlerForError(); givenErrorHandlerForError();
@ -786,7 +787,7 @@ describe('strong-error-handler', function() {
}); });
}); });
var app, _requestHandler, request; var app, _requestHandler, request, server;
function resetRequestHandler() { function resetRequestHandler() {
_requestHandler = null; _requestHandler = null;
} }
@ -834,7 +835,7 @@ function setupHttpServerAndClient(done) {
} }
}); });
app.listen(0, function() { server = app.listen(0, function() {
var url = 'http://127.0.0.1:' + this.address().port; var url = 'http://127.0.0.1:' + this.address().port;
debug('Test server listening on %s', url); debug('Test server listening on %s', url);
request = supertest(app); request = supertest(app);
@ -846,6 +847,10 @@ function setupHttpServerAndClient(done) {
}); });
} }
function stopHttpServerAndClient() {
server.close();
}
function ErrorWithProps(props) { function ErrorWithProps(props) {
this.name = props.name || 'ErrorWithProps'; this.name = props.name || 'ErrorWithProps';
for (var p in props) { for (var p in props) {