dvsa / dvsa-lambda-starter

A starting pattern for AWS lambda in Typescript
MIT License
5 stars 4 forks source link

Add Jest testing framework #8

Closed Andy-Taylor-92 closed 4 years ago

Andy-Taylor-92 commented 4 years ago

This PR is to address #1

AnnaDodson commented 4 years ago

Hi @andytaylorkainos, please add instructions on how to run the tests to the README 😄

Andy-Taylor-92 commented 4 years ago

Hi @andytaylorkainos, please add instructions on how to run the tests to the README 😄

Done :)

AnnaDodson commented 4 years ago

It makes more sense to have the tests in a test directory seperate from the source code. If it's in the same directory, the compiled build archive will also contain the tests unless they're excluded and if there's lots of test files it will get confusing.

Andy-Taylor-92 commented 4 years ago

The reason I moved them to be inline was because I was planning on following the "1 lambda = 1 project" approach where all of the dependencies for that lambda would be contained in their own directory.

I've reverted the commit, but when looking into Layers for lambdas, I suspect the common approach is something similar: https://aws.amazon.com/blogs/compute/working-with-aws-lambda-and-lambda-layers-in-aws-sam/