1

A similar question was asked back in May of last year but unfortunately didn't get any responses so I'd like to expand on it with some details of my own and hopefully gain some understanding of how --findRelatedTests works, because there doesn't seem to be any documentation that describes how it works, just that it does.

In short, what criteria needs to be in place for this for --findRelatedTests to work properly?

  • Do the source file/test file need to be similarly named?

    e.g. Page.jsx and Page.test.js

  • Do the test files need to be in the same folder as the source file, or should they be placed in a separate tests folder?

I ask because I tend to follow the AirBnb project structure for my applications:

- components
  - Page
    - index.jsx
    - style.scss
    - Page.test.js

...and I'd like to know if I updated the Page component index.jsx file whether --findRelatedTests would "know" that Page.test.js is the associated test file?

Andy
  • 61,948
  • 13
  • 68
  • 95
  • I did some digging and came up with an answer to the linked question, since that is higher voted and appears higher in Google. If I don't get accepted there in a while I'll repost here - https://stackoverflow.com/a/51502218/5213573 – Mitch Lillie Jul 24 '18 at 15:19

0 Answers0