DEV Community

Building a JavaScript Auth system using TDD (part 1)

Antonio on October 22, 2018

Every time I want to learn a new programming language or framework I try do a couple of basic apps, like a to do list and then move to something I ...
Collapse
 
emrejen profile image
Eyal Mrejen

Hi Antonio
Great article.
I think you should change the res.send('Yabadabadooo'); with res.json('Yabadabadooo');

Collapse
 
uf4no profile image
Antonio

Thanks, glad you liked it :)
You're right! actually I refactored the code in my repo to send a json:


res.send({
message: 'Hello!'
})

And in the test it's checking the message:

expect(res.statusCode).to.be.eql(200)
expect(res.body.message).to.be.equal('Hello!')

I'll update the article :)