aws-testing-library
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -5,2 +5,3 @@ "use strict"; | ||
const getLogGroupName = (functionName) => `/aws/lambda/${functionName}`; | ||
const hoursToMilliseconds = (hours) => hours * 60 * 60 * 1000; | ||
exports.filterLogEvents = async (region, functionName, pattern) => { | ||
@@ -10,2 +11,3 @@ const cloudWatchLogs = new AWS.CloudWatchLogs({ region }); | ||
const filterPattern = `"${pattern}"`; // enclose with "" to support special characters | ||
const startTime = Date.now() - hoursToMilliseconds(1); | ||
const { events = [] } = await cloudWatchLogs | ||
@@ -17,2 +19,3 @@ .filterLogEvents({ | ||
logGroupName, | ||
startTime, | ||
}) | ||
@@ -19,0 +22,0 @@ .promise(); |
{ | ||
"name": "aws-testing-library", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Chai and Jest matchers for aws services", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
143573
1987