What are tests written on for Node.js projects?

  • 0
    Good night!
    What is the best way to write tests on Node.js projects? On the client, we use react and test projects with Jest, which does a great job.

    I tried to connect it to the project on the node and saw a warning from the developers that Jest was developed as a framework for testing the frontend and that you can use it to test Node at your own risk.
    I plan to test the work of services and their work with databases - mongo & amp; mysql

    Googled what tools are there besides - mocha (+ chai), AVA?
    What is generally relevant and worth using? Or can you use the same Jest, you just need to configure it correctly?
    JavaScript Anonymous, Jun 21, 2020

  • 2 Answers
  • 0
    JEST is quite possible to use, so you write a data validation function that returns either true or false, and you want to check it: are true and false on the front-end different from true and false on the back-end? :) - of course not!

    Use for health!

  • 0
    I use it in a real project, I haven't faced any restrictions, everything works as it should.

    Moreover, I personally don’t remember the warning that you should use the gesture on the node at your own peril and risk (I might not have paid attention), especially since the node support is indicated on the official website.

    And in principle, I don't really understand what is so specific for a node?
    Graham Barr

Your Answer
To place the code, please use CodePen or similar tool. Thanks you!