Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to include and run jest tests in AWS serverless lambda function in CD #54

Open
tachyon83 opened this issue Sep 11, 2023 · 0 comments

Comments

@tachyon83
Copy link

hello there,

I am currenty working on letting AWS serverless lambda run the jest test in CD(continuous development) process.
I have many test files named '....test.ts'. I created a handler that will turn into a serverless lambda function.
In the handler, jest.runCLI... or execSync("npm run jest")... will run.
So, the function is not open API, but dedicated to only testing.
AFAIK, serverless only takes the minimal form of transpiled(compiled) js codes.
However, the handler does not have any direct dependencies on the test files.
So, all the test files are not going to be included in the lambda function.

is there any ways to let the lambda function search and include all the jest test files so that I can run all the tests under serverless (by sls invoke ...)

I hope there is a simple way to achieve this just by playing with some options in yml file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant