0

I know I can run a single test file using Jest.

I also know I can run all the tests in a single workspace with:

yarn workspace @mycompany/somepackage test

But how would I run a single test file within a workspace?

I have tried:

yarn workspace @mycompany/somepackage test packages/somepackage/src/index.int.test.ts

and also:

yarn workspace @mycompany/somepackage test src/index.int.test.ts

As I am unsure whether the 'test' expects paths relative to the workspace or not. Both fail with:

No tests found, exiting with code 1

I am using Yarn v1.22.7 and my tests use Jest.

How do I test a single file using Yarn workspaces?

jonrsharpe
  • 107,083
  • 22
  • 201
  • 376
mikemaccana
  • 94,893
  • 84
  • 350
  • 433

0 Answers0