yarn # install deps and link workspaces
.
├── jest.config.js
├── package.json
└── packages
├── app
│ ├── index.js
│ ├── index.test.js
│ └── package.json
└── button
├── index.js
├── index.test.js
└── package.json
packages/app/index.js
└── packages/button/index.js
jest --findRelatedTests packages/button/index.js
Notice that only the test for button is found.
jest --projects --findRelatedTests packages/header/index.js
# Notice I'm passing empty --projects, with causes Jest to act as a single root project
Notice that both the test for app and button are found