From 3459caeaa175e17b682049711c5e21bd75925132 Mon Sep 17 00:00:00 2001 From: abetomo Date: Tue, 18 Apr 2017 13:17:30 +0900 Subject: [PATCH] Bugfix for backward compatible objects --- lib/main.js | 5 ++++- test/main.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/main.js b/lib/main.js index 1e1eae9e..529e7f35 100644 --- a/lib/main.js +++ b/lib/main.js @@ -153,7 +153,10 @@ Lambda.prototype._eventSourceList = function (program) { if (Object.prototype.toString.call(list) === '[object Array]') { // backward-compatible - return { EventSourceMappings: list }; + return { + EventSourceMappings: list, + ScheduleEvents: [] + }; } if (!list.EventSourceMappings) { list.EventSourceMappings = []; diff --git a/test/main.js b/test/main.js index f037b8a0..659e3105 100644 --- a/test/main.js +++ b/test/main.js @@ -593,7 +593,10 @@ describe('node-lambda', function () { it('program.eventSourceFile is valid value', function () { program.eventSourceFile = fileName; - const expected = { EventSourceMappings: oldStyleValue }; + const expected = { + EventSourceMappings: oldStyleValue, + ScheduleEvents: [] + }; assert.deepEqual(lambda._eventSourceList(program), expected); }); });