Service requests using the example of tests

Examples of requests to the main REST services can be found in the tests prepared for these services. Tests are written for mocha and are located in the app and develop-and-test repository.

To run the tests, you need to install the request-promise-native and mocha``packages , for example, by running ``npm install in the folder develop-and-test/test.

First you need to configure the server and user parameters in develop-and-test/test/modules/rest/config.js.

The launch is done by calling mocha/lib/cli/cli.js for the test script, for example:

node node_modules/mocha/lib/cli/cli.js modules/rest/echo.spec.js

You can run all the tests in the folder:

node node_modules/mocha/lib/cli/cli.js modules/rest/*.spec.js

It is also possible to run individual unit tests:

node node_modules/mocha/lib/cli/cli.js -g "<ЧАСТЬ НАЗВАНИЯ ТЕСТА>" modules/rest/*.spec.js

for example:

node node_modules/mocha/lib/cli/cli.js -g "creating an object" modules/rest/*.spec.js