You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 17, 2019. It is now read-only.
Many developers have a need for fixtures and helper libraries for running test logic. With the current naming scheme that we have for universal tests, developers can't easily have additional utilities inside of the __tests__ folder.
Current behavior
Any files ending in .js inside of a __tests__ folder will attempt to execute as a jest test. When run, jest will fail with an error like:
● Test suite failed to run
Your test suite must contain at least one test.
Expected behavior
You should be able to run tests and ignore utilities, helpers and fixtures.
Possible fixes
Whitelist a support folder
Any files within this folder would not be considered tests. If there are tests in a folder named __tests__/support this would be a breaking change, but we might consider this one to be non-breaking as that seems pretty unlikely.
Reconsider universal test naming scheme
Rename universal tests to something like myTest.global.js or myTest.universal.js. We would then support myTest.(universal|node|browser).js. Breaking change.
The text was updated successfully, but these errors were encountered:
Shouldn't only root files inside a given tests directory be considered tests? For example:
This is one convention that we can look at as well. Because we encourage co-locating tests with code, folks shouldn't need nested directory structures for tests.
Type of issue
Feature request
Description
Many developers have a need for fixtures and helper libraries for running test logic. With the current naming scheme that we have for universal tests, developers can't easily have additional utilities inside of the
__tests__
folder.Current behavior
Any files ending in
.js
inside of a__tests__
folder will attempt to execute as a jest test. When run, jest will fail with an error like:Expected behavior
You should be able to run tests and ignore utilities, helpers and fixtures.
Possible fixes
Whitelist a
support
folderAny files within this folder would not be considered tests. If there are tests in a folder named
__tests__/support
this would be a breaking change, but we might consider this one to be non-breaking as that seems pretty unlikely.Reconsider universal test naming scheme
Rename universal tests to something like
myTest.global.js
ormyTest.universal.js
. We would then supportmyTest.(universal|node|browser).js
. Breaking change.The text was updated successfully, but these errors were encountered: