Notes on Jest, JavaScript Testing

Jest is from Facebook, it comes pre-installed in Create React App. It’s a good idea to install Jest globally since I will be using it from now on. Or install as a dev dependency: Run it with npm test by adding jest –watchAll in the package.json file. 3 ways to add test files: Put all the test files in __tests__ directory within the project folder Add files with .test.js Add files with .spec.js I like to add .spec.js inside each of my React component files. Each test per component stays on their component folder. For tesing general JavaScript, I will …

Read More