lambda-wrapper
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -23,3 +23,3 @@ | ||
try { | ||
this.lambdaModule.handler(event, lambdacontext); | ||
this.lambdaModule.handler(event, lambdacontext, callback); | ||
} catch (ex) { | ||
@@ -26,0 +26,0 @@ throw(ex); |
{ | ||
"name": "lambda-wrapper", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Wrapper for running Amazon Lambda modules locally", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha" | ||
}, | ||
@@ -9,0 +9,0 @@ "repository": { |
var testMod1 = { | ||
handler: function(event, context) { | ||
if (event.test === 'success') { | ||
context.succeed('Success'); | ||
} | ||
if (event.test === 'fail') { | ||
context.fail('Fail'); | ||
} | ||
handler: function(event, context) { | ||
if (event.test === 'success') { | ||
context.succeed('Success'); | ||
} | ||
if (event.test === 'fail') { | ||
context.fail('Fail'); | ||
} | ||
} | ||
}; | ||
var testMod2 = { | ||
handler: function(event, context) { | ||
context.succeed(event); | ||
} | ||
handler: function(event, context) { | ||
context.succeed(event); | ||
} | ||
}; | ||
var testMod3 = { | ||
handler: function(event, context, callback) { | ||
callback(null, event); | ||
} | ||
} | ||
var wrapper = require('../index.js'); | ||
@@ -52,2 +58,10 @@ var expect = require('chai').expect; | ||
}); | ||
it('wrap + run module 3 (callback notation)', function(done) { | ||
var w1 = wrapper.wrap(testMod3); | ||
w1.run({test: 'cbsuccess'}, function(err, response) { | ||
expect(response.test).to.be.equal('cbsuccess'); | ||
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
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
7125
104
1