folder 01
- Automate the process of ensuring that our app works as we expect
- Keep us from having to manually click around the app to find bugs
- Make sure the app still works as expected even after twe change something
- People spend more time setting up testing than they do writing tests
- All testing frameworks / libraries are essentially the same
- You don't even have to use a testing library
npm run test index.test.js
https://chaijs.com Is what we call an expectation library or an assertion library is the library that allows us to use those same kind of assert statements that we saw at that node module.
https://www.chaijs.com/guide/styles/#expect
document.querySelector('input').value = 'Avenger'
Faking the event with mocha
document.querySelector('input').dispatchEvent(new Event('input'))