re: Building a JavaScript Auth system using TDD (part 1) VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Hi Antonio Great article. I think you should change the res.send('Yabadabadooo'); with res.json('Yabadabadooo');
 

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 :)

code of conduct - report abuse