When I execute tests I got:
FAIL src/test/javascript/app/actions.spec.js
● Test suite failed to run
ENOENT: no such file or directory, mkdir '/tmp/jest_rs/jest-transform-cache-951c940de58b523ede4c7a74cd57e1d8-afca7609b727bae58e6d966e4f38887d/2e'
at createDirectory (node_modules/jest-runtime/node_modules/jest-util/build/createDirectory.js:68:10)
No matter what I do(clear cache, run with --no-cache) then the result is the same. But when I create this directory by
mkdir -p /tmp/jest_rs/jest-transform-cache-951c940de58b523ede4c7a74cd57e1d8-afca7609b727bae58e6d966e4f38887d/2e
then an exception is different:
FAIL src/test/javascript/app/modeler/actions.spec.js
● Test suite failed to run
The error below may be caused by using the wrong test environment, see https://jestjs.io/docs/en/configuration#testenvironment-string.
Consider using the "jsdom" test environment.
ReferenceError: window is not defined
1 | import React from 'react';
2 |
> 3 | window.React = React;
This is from mt setupTests.js that I have in the setupFilesAfterEnv.
testEnvironment is set to jsdom. When I check that by --show-config I have:
"testEnvironment": "/node_modules/jest-environment-jsdom/build/index.js",
System:
OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 10.10.0 - /usr/bin/node
Yarn: 1.10.1 - ~/projects/bpm-micro/gateway/node_modules/.bin/yarn
npm: 5.1.0 - ~/projects/bpm-micro/gateway/node_modules/.bin/npm
npmPackages:
jest: ^26.0.1 => 26.1.0
@mkawczynski07
Marek, try to update node. I updated it to 6.14.6 from 6.4.1 and it looks it was the case.
Same problem but on Windows 10. I have node version 10.10.0
EDIT:
Fixed it by using jest v25.1.0
@pawel-sz Didn't help.
same here on mac, downgrading jest-util to ^25.0.0 works for me
same for me too, still having an issue on jest-util 26.0.4
Downgrading jest to ^25.0.0 fixed the issue for me too :) Node 10.9.0, Ubuntu 20.04
This needs a reproducion.
Node Version <10.12 doesn’t support recursive options from fs.mkdir and fs.mkdirSync.
https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V10.md#2018-10-10-version-10120-current-targos
Jest 26 doesn't support node <10.14.2. https://github.com/facebook/jest/blob/2f6931e91d5ab126de70caf150c68709752e7f6c/packages/jest/package.json#L14
Most helpful comment
Same problem but on Windows 10. I have node version 10.10.0
EDIT:
Fixed it by using jest v25.1.0