vendredi 2 novembre 2018

Jest test to see if *.spec.tsx files exist

I have a TypeScript project that contains a bunch of files in different directories all located under src/.

Is it possible to write a Jest test so that it only returns success if each *.tsx file found under the parent directory (src/) has a corresponding *.spec.tsx test file?

In other words if I have the following 3 files:

src/index.tsx
src/foo.tsx
src/folder/component.tsx

The Jest test would fail until such time that the following files are created:

src/index.spec.tsx
src/foo.spec.tsx
src/folder/component.spec.tsx

Aucun commentaire:

Enregistrer un commentaire