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 run all tests that are in different directories #140

Open
amimas opened this issue Mar 25, 2021 · 1 comment
Open

How to run all tests that are in different directories #140

amimas opened this issue Mar 25, 2021 · 1 comment

Comments

@amimas
Copy link

amimas commented Mar 25, 2021

Hi,

I'm working with a project that has several functions organized in different directories. The tests are also in corresponding directories. Below is an example of what the directory structure looks like.

.
└── handlers
    ├── function-one
    │   ├── fixtures
    │   └── test
    ├── function-two
    │   ├── fixtures
    │   └── test
    ├── function-three
    │   ├── fixtures
    │   └── test

Right now I can run tests for each of those individual functions by running sls invoke test --function function-one --path=handlers/function-one/test.

Is there an option so that I can run tests for all functions? I tried to use a glob pattern for the path parameter (i.e. sls invoke test --path=handlers/**/test), but that doesn't work.

Ofcourse I can create a separate script to parse through each directories and then run the tests for each function as a separate invokation. I'm wondering if there's a native way of handling this without requiring a separate script.

@dattran1999
Copy link

What is the error message? I found something on stackoverflow that might be useful https://stackoverflow.com/questions/10753288/how-to-specify-test-directory-for-mocha

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

2 participants