Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to call all test in one folder using jest pattern matching?

I have my regular unit tests in folders with my services

Now I created new folder called integration/ and inside this folder all my tests look like anotherFolder/testSomeApi.integration.js

I did this, so that when I call node jest, it runs all the unit tests but not the integration tests. I want to call integration tests from my docker container with separate command

How can I call something like jest *integration.js so that all tests in integration folder with extension integration.js gets called?

like image 846
Tree Avatar asked Oct 21 '25 14:10

Tree


1 Answers

jest --testPathPattern=".*/folderName/.*.spec.ts"

is working for me.

like image 56
Manoj Avatar answered Oct 24 '25 05:10

Manoj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!