Public Repository

Last pushed: a month ago
Short Description
Runs subset of DeviceHive tests on pointed instances
Full Description

Integration tests

Prepare running environment

Integration tests require mocha framework.

  • Install mocha globally: $ sudo npm install -g mocha, Windows: > npm install -g mocha

  • cd to project root directory: $ cd devicehive-tests

  • Install Node.js references: Linux: $ sudo npm i, Windows: > npm i

  • When running specify tests directory 'integration-tests': $ mocha integration-tests

  • More advanced example of running tests with JSON reporter: $ mocha -R json integration-tests/rest-access-key.js > result.json

You can pick any of alternative reporters available in Mocha framework or third-party reporter, like mochawesome.

  • Install mochawesome globally: $ sudo npm install -g mochawesome, Windows: $ npm install -g mochawesome

  • Run tests: $ mocha -R mochawesome integration-tests.
    In order to set ip and port use: $ mocha -R mochawesome integration-tests --ip=${ip} --port=${port}. Default values: ${ip} = 127.0.0.1 ${port} = 8080**

Another easy way to run tests is to use WebStorm

When running tests in WebStorm you can export test results to .html file:

Tests structure

  • describe() closure defines a group of tests
  • it() defines a single test

Dealing with failures

  • Use only() predecate to run separate test or separate group of tests. This can be helpful to run the failed test only:

Following code will only execute '#Group of Tests' group:

  • To ignore test use skip() predicate:

Docker Pull Command
Owner
sitnik

Comments (0)