Skip to content
This repository has been archived by the owner on Apr 17, 2021. It is now read-only.

Commit

Permalink
Add initial testing setup for lambdas with tests for eventbrite producer
Browse files Browse the repository at this point in the history
  • Loading branch information
alistairjcbrown committed Oct 27, 2018
1 parent 4e96aff commit 94d124b
Show file tree
Hide file tree
Showing 18 changed files with 7,012 additions and 430 deletions.
8 changes: 4 additions & 4 deletions lambdas/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"airbnb-base/legacy",
"prettier"
],
"plugins": ["prettier"],
"plugins": ["jest", "prettier"],
"env": {
},
"globals": {
"Promise": true
"jest/globals": true,
"node": true,
"es6": true
},
"rules": {
"prettier/prettier": "error",
Expand Down
4 changes: 4 additions & 0 deletions lambdas/Dockerfile-test
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ WORKDIR /lambdas-test/
RUN npm install

COPY . /lambdas-test/

RUN cd eventbrite && npm install
RUN cd farsetlabs && npm install
RUN cd meetupcom && npm install
2 changes: 1 addition & 1 deletion lambdas/eventbrite/handlers/producer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const getErrors = function(eventsPages) {
};

const getFromApi = async function() {
const initialResponse = await getFromWeb(getEventsUrl({ page: 0 }));
const initialResponse = await getFromWeb(getEventsUrl({ page: 1 }));
const initialData = JSON.parse(initialResponse);

if (initialData.error) return [initialResponse];
Expand Down
2 changes: 1 addition & 1 deletion lambdas/eventbrite/handlers/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module.exports.transform = async (event, context, callback) => {
const validEvents = transformedEvents.filter(isValidEvent);

if (validEvents.length !== transformedEvents.length) {
console.log("WARNING: some events generated were not valid!");
console.log("WARNING: some events generated were not valid!"); // eslint-disable-line no-console
}

return validEvents;
Expand Down
Loading

0 comments on commit 94d124b

Please sign in to comment.