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
I created an app using create-react-native-app and ran yarn test that uses jest --watch. And It threw the error:
Determining test suites to run...Error: This promise must be present when running with -o.
at /Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/search_source.js:202:17
at Generator.next (<anonymous>)
at step (/Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/search_source.js:19:362)
at /Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/search_source.js:19:592
at new Promise (<anonymous>)
at /Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/search_source.js:19:273
at SearchSource.getTestPaths (/Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/search_source.js:216:10)
at /Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/run_jest.js:44:29
at Generator.next (<anonymous>)
at step (/Users/arthurkhusaenov/Codes/AwesomeProject/node_modules/jest-cli/build/run_jest.js:23:380)
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.
rm –rf .git in some project that uses Jest. Then jest --watch
Jest can only find uncommitted changed files in a git or hg repository. If you make your project a git or hg repository (`git init` or `hg init`), Jest will be able to only run tests related to files changed since the last commit.
No tests found related to files changed since last commit.
If jest --watch runs jest -o by default then should jest --watch shows the same message in this case?
if (!data.tests.length && globalConfig.onlyChanged && data.noSCM) {
if (globalConfig.watch) {
data = await source.getTestPaths(globalConfig);
} else {
new Console(outputStream, outputStream).log(
'Jest can only find uncommitted changed files in a git or hg ' +
'repository. If you make your project a git or hg ' +
'repository (`git init` or `hg init`), Jest will be able ' +
'to only run tests related to files changed since the last ' +
'commit.',
);
}
}
In first if statement it's true && true && true and here if (globalConfig.watch) it’s also true because I use --watch. So I think it should be:
if (!data.tests.length && globalConfig.onlyChanged && data.noSCM) {
new Console(outputStream, outputStream).log(
'Jest can only find uncommitted changed files in a git or hg ' +
'repository. If you make your project a git or hg ' +
'repository (`git init` or `hg init`), Jest will be able ' +
'to only run tests related to files changed since the last ' +
'commit.',
);
}
But what do you think guys, can I change that or I missed something?
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
bug
What is the current behavior?
I created an app using
create-react-native-app
and ranyarn test
that usesjest --watch
. And It threw the error:If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.rm –rf .git
in some project that uses Jest. Thenjest --watch
What is the expected behavior?
I saw docs https://facebook.github.io/jest/docs/en/cli.html#running-from-the-command-line and found
jest --watch
runsjest -o
by default. So I triedjest -o
and I’ve got the clear message:If
jest --watch
runsjest -o
by default then shouldjest --watch
shows the same message in this case?It happens here https://github.com/facebook/jest/blob/master/packages/jest-cli/src/run_jest.js#L45
In first if statement it's
true && true && true
and hereif (globalConfig.watch)
it’s alsotrue
because I use--watch
. So I think it should be:But what do you think guys, can I change that or I missed something?
The text was updated successfully, but these errors were encountered: