aws-lambda-helper
Advanced tools
Comparing version 2.16.0 to 2.16.1
@@ -364,2 +364,7 @@ 'use strict'; | ||
AwsHelper.pushResultToClient = function (params, callback) { | ||
if (!params.id) { | ||
const msg = 'id property is required to return results to client'; | ||
AwsHelper.log.error({data: params}, msg); | ||
return callback(new Error(msg)); | ||
} | ||
// push to WebSocket Server | ||
@@ -366,0 +371,0 @@ pushToSNSTopic(params, function (err, data) { |
{ | ||
"name": "aws-lambda-helper", | ||
"version": "2.16.0", | ||
"version": "2.16.1", | ||
"description": "Collection of helper methods for lambda", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -6,3 +6,3 @@ // this test needs to run *FIRST* for some reason ... any help figuring out why much appreciated. | ||
describe('pushToSocketServer', function () { | ||
describe('pushResultToClient', function () { | ||
before('Connect to WebSocket Server', function (done) { | ||
@@ -54,2 +54,17 @@ AwsHelper.init({ | ||
}); | ||
it('calls back with error if no id property is present on the params', (done) => { | ||
var params = { | ||
searchId: 'ABC', | ||
userId: 'TESTUSERID', | ||
items: [{ | ||
id: 123, hello: 'world', title: 'amazing holiday', | ||
url: 'userId/connectionId/bucketId/123' | ||
}] | ||
}; | ||
AwsHelper.pushResultToClient(params, function (err, res) { | ||
assert(err); | ||
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
188419
29
1515