Skip to content
Advertisement

How to configure package.json to run test case file which ends with similar names?

I am trying to configure package.json to run test cases with similar names. In my case i have two different naming conventions,one for unit test and another for integration test. I need to run only unit test by giving a command which picks only unit test case files and same with the integration test files.

unit test case file naming convention

JavaScript

integration test case file naming convention

JavaScript

package.json(Attached only test configuration part)

JavaScript

Advertisement

Answer

I think this would work (as jest accepts a regex pattern):

JavaScript
Advertisement