Comparing version 0.2.7 to 0.2.8
@@ -11,2 +11,6 @@ 'use strict'; | ||
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray'); | ||
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -19,6 +23,12 @@ | ||
module.exports = function (options) { | ||
// TODO: Allow passing additional providers and options | ||
var providers = [HttpResponseProvider(), ServerlessRequestProvider()]; | ||
if (Array.isArray(options.providers)) { | ||
providers.push.apply(providers, (0, _toConsumableArray3.default)(options.providers)); | ||
} | ||
var arnie = A({ | ||
providers: [HttpResponseProvider(), ServerlessRequestProvider()] | ||
providers: providers | ||
}); | ||
return function (task) { | ||
@@ -25,0 +35,0 @@ return function (event, context, cb) { |
{ | ||
"name": "arnie", | ||
"version": "0.2.7", | ||
"version": "0.2.8", | ||
"description": "Action hero for backends", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,9 +6,15 @@ const A = require('../') | ||
module.exports = (options) => { | ||
// TODO: Allow passing additional providers and options | ||
const providers = [ | ||
HttpResponseProvider(), | ||
ServerlessRequestProvider() | ||
] | ||
if (Array.isArray(options.providers)) { | ||
providers.push(...options.providers) | ||
} | ||
const arnie = A({ | ||
providers: [ | ||
HttpResponseProvider(), | ||
ServerlessRequestProvider() | ||
] | ||
providers | ||
}) | ||
return (task) => { | ||
@@ -15,0 +21,0 @@ return (event, context, cb) => { |
const test = require('tape') | ||
const {setupServerless} = require('../utils/serverless') | ||
const A = require('../../src/adapters/serverless') | ||
const arnie = A() | ||
test('Adapter: Serverless', (t) => { | ||
t.plan(9) | ||
t.plan(10) | ||
const arnie = A({providers: [ | ||
(context) => { | ||
context.anotherProvider = 'test' | ||
return context | ||
} | ||
]}) | ||
const actionNum = { | ||
@@ -20,2 +26,3 @@ taskA: 0, | ||
(ctx) => { | ||
t.equal(ctx.anotherProvider, 'test', 'should pass additional providers to function-tree') | ||
testExecutionOrder('taskA', 1) | ||
@@ -22,0 +29,0 @@ throw expectedError |
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
170715
3931