Comparing version 2.3.1 to 2.3.2
@@ -50,2 +50,7 @@ 'use strict'; | ||
//todo | ||
if (request.response.isBoom) { | ||
return reply.continue(); | ||
} | ||
const acceptHeader = request.headers.accept; | ||
@@ -52,0 +57,0 @@ |
{ | ||
"name": "hapi-csv", | ||
"version": "2.3.1", | ||
"version": "2.3.2", | ||
"description": "Hapi plugin for converting a Joi response schema and dataset to csv", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -36,3 +36,3 @@ 'use strict'; | ||
describe('Basic convertions', () => { | ||
describe('Basic conversions', () => { | ||
@@ -78,2 +78,11 @@ let simpleServer; | ||
} | ||
}, { | ||
method: 'GET', | ||
path: '/error', | ||
config: { | ||
handler: function (request, reply) { | ||
return reply(new Error()); | ||
} | ||
} | ||
}]); | ||
@@ -215,5 +224,26 @@ | ||
}); | ||
it('Passes on errors', (done) => { | ||
return simpleServer.inject({ | ||
method: 'GET', | ||
url: '/error', | ||
headers: { | ||
Accept: 'text/csv' | ||
} | ||
}, (res) => { | ||
expect(res.headers['content-type']).to.equal('application/json; charset=utf-8'); | ||
expect(res.result).to.equal({ | ||
statusCode: 500, | ||
error: 'Internal Server Error', | ||
message: 'An internal server error occurred' | ||
}); | ||
return done(); | ||
}); | ||
}); | ||
}); | ||
describe('Advanced convertions', () => { | ||
describe('Advanced conversions', () => { | ||
@@ -220,0 +250,0 @@ it('Converts more advanced, nested schema', (done) => { |
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
24339
514