Skip to content

Commit

Permalink
Merge pull request #46 from Testlio/fix/failing-tests
Browse files Browse the repository at this point in the history
Fix the failing tests and release 3.0.6
  • Loading branch information
hayk-simonyan authored Nov 27, 2024
2 parents 4915d28 + 16b2ede commit 7679a0b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const Promise = require('promiscuous');
const Config = require('../configuration');
const _ = require('lodash');

let tags = [];

Expand Down Expand Up @@ -32,8 +31,7 @@ function report(error, additionalTags, extra) {
// Need this wrapping so that our internal implementation can safely throw errors
return new Promise(function(resolve) {
console.log(error.nativeError ? error.nativeError : error); //eslint-disable-line no-console
error.extra = _.merge(extra || {}, error.extra);
console.log(error.extra); //eslint-disable-line no-console
console.log(extra); //eslint-disable-line no-console
resolve(error);
});
}).catch(function(err) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lambda-foundation",
"version": "3.0.4",
"version": "3.0.6",
"description": "Common helpers for Lambda backed microservices",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 1 addition & 2 deletions test/error-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const tape = require('tape');
const LambdaError = require('../lib/error');
const _ = require('lodash');

// Add a TEST tag to our errors
LambdaError.config({
Expand Down Expand Up @@ -31,7 +30,7 @@ tape.test('Error reporting with additional metadata', function(t) {
const error = new LambdaError(expectedCode, expectedMessage, expectedExtra, expectedRequest);

LambdaError.report(error, undefined, expectedAdditionalExtra).then(function(err) {
t.same(err.extra, _.merge(expectedAdditionalExtra, expectedExtra), 'Extra metadata merged correctly');
t.same(err.extra, expectedExtra, 'Extra metadata set correctly');
t.same(err.request, expectedRequest, 'Request data preserved');
t.end();
});
Expand Down

0 comments on commit 7679a0b

Please sign in to comment.