运行命令jest --bail --findRelatedTests src/components/BannerSet/BannerSet.tsx
时,我收到以下消息:
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in C:\Users\user\code\repo.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: facebook.github.io/jest/docs/configuration.html
Pattern: .\\src\\components\\BannerSet\\BannerSet.tsx - 0 matches
但是我确实准备好了文件:
src/components/BannerSet/BannerSet.test.tsx
src/components/BannerSet/BannerSet.tsx
为什么Jest无法找到相关测试?仅运行jest
即可正常运行。