What could I do to improve my testing? What could I do to improve my testing? mongoose mongoose

What could I do to improve my testing?


All in all it seems that your tests cover the code.Perhaps you could add a few more URLs to better test the validUrl function.

Generally the amount of testing to be done depends on your needs. Whether you need more tests or not depends on many things, such as: your confidence in your code, the number of people that may touch your code and "break" it, the size and complexity of the overall system, the users of your code (are they part of your team or outsiders?), the source of the data (is it validated before it reaches your code?) and your level of paranoia. There's no one-fits-all answer.