"No tests found" on docker with Jest v22 and v23
See original GitHub issue💥 Regression Report
Running under Jest in a docker container is unable to find tests in v22 or v23, but can in v21. There are no problems running locally on OSX. Node version does not seem to be related.
Last working version
Version 21.2.1
Stopped working in version:
I believe version 22.0.0
, but based on other jest dependencies installed (jest-cli
, etc.) it’s hard to tell. Certainly in 22.4.4
.
To Reproduce
Minimal set of files are in this repo: https://github.com/alistairjcbrown/jest-docker-issue
With jest 21.2.1
in the package.json
file, docker-compose run test
which runs jest
, finds files and passes.
With jest 22.4.4
in the package.json
file, docker-compose run test
which runs jest
, fails to find test files.
Expected behavior
With jest 22.4.4
(or above) in the package.json
file, docker-compose run test
should find test files and run them.
Link to repl or repo (highly encouraged)
Minimal repository: https://github.com/alistairjcbrown/jest-docker-issue
Run npx envinfo --preset jest
Paste the results here:
> $ docker-compose run test npx envinfo --preset jest
npx: installed 1 in 1.232s
System:
OS: Linux 4.9 Debian GNU/Linux 8 (jessie) 8 (jessie)
CPU: x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
Binaries:
Node: 10.6.0 - /usr/local/bin/node
Yarn: 1.7.0 - /usr/local/bin/yarn
npm: 6.1.0 - /usr/local/bin/npm
npmPackages:
jest: 22.4.4 => 22.4.4
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
Looks like this can be worked around by creating a directory to copy files into and setting up a
WORKDIR
- maybe something in Jest v22 changed how it dealt with searching through top level files in a docker container? Using a work directory makes sense to me (though my docker knowledge is still fairly new).I’ve created a branch off the minimal repository with the changes required to work and confirmed working with both latest v22 and v23. Branch diff: https://github.com/alistairjcbrown/jest-docker-issue/compare/use-work-directory
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.