Great article! Note: I needed to assign "jest" to the "test" script in my package.json file in order for the npm run test script to work.
"scripts": {
"test": "jest"
},
Out of the box, that comes as
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
Also, I can confirm that in Oct '22, I did not need to create the .bablerc config file. I found this article because I was trying to use spyOn and getting the error: SyntaxError: The requested module jest/globals does not provide an export named spyOn. Installing the plugin to transform ES6 (modules) to CommonJS (@babel/plugin-transform-modules-commonjs) fixed this issue, exposing the spyOn function properly for use in my test files.