diff --git a/aws/email-importer/.gitignore b/aws/email-importer/.gitignore index a5941011..e1819b86 100644 --- a/aws/email-importer/.gitignore +++ b/aws/email-importer/.gitignore @@ -3,3 +3,4 @@ env.json .aws-sam .serverless +.esbuild diff --git a/aws/email-importer/Makefile b/aws/email-importer/Makefile index bf7f99bc..af0de41d 100644 --- a/aws/email-importer/Makefile +++ b/aws/email-importer/Makefile @@ -5,4 +5,7 @@ logs: # AWS Lambda logs for the function npx serverless logs --function importer --tail --stage production invoke-with-test-event: # Invoke the function with a test event - npx serverless invoke --function importer --stage production --path fixtures/test-event.json --log \ No newline at end of file + npx serverless invoke --function importer --stage production --path fixtures/test-event.json --log + +invoke-local: # Invoke the function with a test event + npx serverless invoke local --function importer --stage production --path fixtures/test-event.json \ No newline at end of file diff --git a/aws/email-importer/README.md b/aws/email-importer/README.md index e255b65c..8ebda23e 100644 --- a/aws/email-importer/README.md +++ b/aws/email-importer/README.md @@ -17,7 +17,10 @@ sequenceDiagram ## 🧰 Local development -The easiest way to run the Lambda function locally is likely through the test suite. The Serverless CLI can also be used to [invoke the function directly](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local). +There's a few ways to test this locally: + +1. Through the test suite. See below. This runs against a local Firebase emulator. +2. Run `make invoke-local` to use the Serverless CLI to [invoke the function directly](https://www.serverless.com/framework/docs/providers/aws/cli-reference/invoke-local). By default, this uses a test event with a `test: true` property, in order to not make requests to the database. ## 🧪 Testing