
TL:DR Make sure your version of Jest is up to date.
Short and sweet if you are seeing this it’s caused by running an older version of Jest, in our case 25.5.4.
Upgrade to the latest, or at least 26.6.3, and it will be resolved.
You can check if you’re using the latest version with:
npm outdated jest
Upgrading can be done with
npm install --save-dev jest@latest
The topic of how to handle the evergreen nature of the web and its ecology I’ve talked about before see Impact of Evergreen Platforms on Development and how not to handle it I’ll come back to it with again I’m sure.
TL:DR Make sure your version of Jest is up to date.

TL;DR Don’t forget to “dotenv/config” for those jest tests that need to access process.env.
Just spent an hour wondering why a jest test is not picking up process.env variables.
It’s embarrassingly simple as you can see from this gist:
However I had forgotten the import “dotenv/config”.
I then realized that I don’t have a good ‘minimal’ starter project for setting up TypeScript, Jest and Node so I used this simple example to create a good project: https://github.com/Simple-Innovation/simple-jest-dotenv.
Its also a template repository so you can use it to quickly get started for new node, typescript and jest projects.
Enjoy.
TL;DR Don’t forget to “dotenv/config” for those jest tests that need to access process.env.