DEV Community

Discussion on: Testing Node API with Mocha & Chai

 
easybuoy profile image
Ekunola Ezekiel • Edited

That's wired, let's try making the first request in a before hook, and then use the token where needed.

You can search here and see an implementation for hooks: mochajs.org/

Thread Thread
 
nivedithamnj profile image
nivedithaMNJ

Hi! I have the code working now but the before/before each didn't seem to work as expected. I realized I was making a mistake while parsing the JSON response.
Thanks a lot for helping.