Answer the question
In order to leave comments, you need to log in
Is testing (like mocha) necessary when writing a REST API?
written api for a web application, there are basically CRUD operations in the database. All errors are processed. Does it need to be tested with special frameworks at all? How to test something like this piece of code
`User.findById(id, (err, user) => {
if (err) throw err;
if (user === null) res.send('user not found');
// do something with the user
})`
Explain. thanks in advance
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question