Do you want to request a feature or report a bug?
bug
What is the current behavior?
moduleNameMapper to map a certain character as an alias (in my case I used @)jest with --watch flag, import the wrong file by forgetting the / in @/myModule, i.e. @myModuleDetermining test suites to run... until you kill the process.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.
What is the expected behavior?
Cannot find module error messagePlease provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Obviously, this is user error, but the accidental omission of '/' caused a serious headache. If this isn't a bug, at least this issue could be referred to help anyone else in similar situation.
I got this issue too in version 21. But in version 20, the error was displayed as expected.
Not sure if related, but I get Determining test suites to run..., and the the whole thing stalls. If I try --watchAll, everything works with no errors, but then hitting o and going to normal watch mode gives the same message again and hangs. Only happens in version 21. Downgrading to 20.0.4 fixes the problem.
I also just ran into this error after upgrading to Jest 21. It was similarly an issue where one of my moduleNameMappers pointed to a non-existant file.
I can confirm this is happening to me as well, but from what I can tell, my moduleNameMapper isn't pointing to a non-existent file. I don't get any errors when I run Jest watchAll.
I have the same problem but it's a bit more than an inconvenience...
I do have an angular project and use the path typescript feature to define paths as @shared or @books instead of the path.
So all my paths are @something and not @/something... will have to change all of them, I think...
same issue here, my setup:
"moduleNameMapper": {
"@app/(.*)": "<rootDir>/src/$1"
}
This works fine when I run jest or jest --watchAll but hangs on Determining test suites to run... forever when I run jest --watch.
I'm seeing the same behavior as @Mohamed3on mentioned. I am using Jest 23.1.0.
What's odd is that if you kill and rerun the command it'll eventually start working immediately.
Most helpful comment
I can confirm this is happening to me as well, but from what I can tell, my
moduleNameMapperisn't pointing to a non-existent file. I don't get any errors when I run JestwatchAll.