Topics:
- Mocha
- Chai
- Sinon
- Assert
- Expect
- The objective is to get you exposed to unit testing with Mocha/Chai and Sinon.
- You will be writing tests for the code inside of
src/app.js
.
- cd into repo and run
yarn install
ornpm install
- You'll notice we have two directories
src
andtest
. Inside ofsrc/app.js & src/functions.js
you'll see all the code that we want to test, being exported out of the given files. - Go ahead and run
yarn test
ornpm test
and it will execute the testing suites. - We have installed a watch command that will re run on save.
- Step 1: You have a broken test suite already, go ahead and change each test assertion such that it passes the expected test. Everything begins on line 14 inside of
tests/types.test.js
begin there. - Step 2: After you have all of your tests passing inside of
types.test.js
you can start testing the functions found in thesrc/functions.js
file.- Write your testing code for these functions inside of
tests/functions.test.js
- Write your testing code for these functions inside of