M
M
msdosx862018-04-11 14:00:29
Software testing
msdosx86, 2018-04-11 14:00:29

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 question

Ask a Question

731 491 924 answers to any question