This is demonstration of a bug described in this jest issue
git clone https://github.com/lo-tp/jestBugDemonstration.git
cd jestBugDemonstration
yarn install
yarn run test -- --no-cache
, this should fail sincets-jest
transformer is not capable to transformES6
code.- Edit jest.json and change the transform argument from
<rootDir>/node_modules/ts-jest/preprocessor.js
totypescript-babel-jest
yarn run test
, now we our transformer is able to transformES6
code so we should be able to pass the test. However due to the cache problem what is waiting for us is still a failure.yarn run test -- --no-cache
, now every thing is ok since we have disabled the cache feature of jest.
Clearly, something went wrong with the caching mechanism.