Open saraiyakush opened 1 month ago
Hey @saraiyakush thanks for raising the feature request. Your proposal makes sense and I think it's a good feature to add. Feel free to raise a PR. We will review it when it's ready!
FYI the underlying build workflow is powered by AWS Lambda Builders - https://github.com/aws/aws-lambda-builders. I think your change will likely be made in Lambda Builders
Opened the PR https://github.com/aws/aws-lambda-builders/pull/681
Describe your idea/feature/enhancement
The
sam build
command should run tests as well for Node runtime, just like it does for Java runtime.Proposal
Include one more step below in the npm builder to run any available tests. One way to do this is to include a step that runs
npm run test
command, which will eventually run the command as specified in thepackage.json
.Things to consider:
Additional Details
I came across this limitation where I was maintaining two SAM projects - one with Java and one with Node. We used
sam build
in our pipeline for both of them and I noticed that the sam build command ran the Java unit tests but not for Node. I think this will be a great feature to be added.I am very much interested to work on this feature and can open a PR if you think this is worth it.