Editing Test Scripts in package.json

Prev Next

You can edit the scripts in the package.json to change the log level for testing.

  • The adapter logs the options for the HTTP request as well as the response it receives in debug mode. Hence, when errors occur, it is preferfable to run the tests in debug mode.
  • The adapter logs every step it takes in trace mode. Often, these logs are too frequent to be useful, and should only be used to isolate what part of the adapter is having issues.

Example: Edited Script

"scripts": {
..
  "test:unit": "mocha test/unit/adapterTestUnit.js --LOG=error",
  "test:integration": "mocha test/integration/adapterTestIntegration.js --LOG=error",
  "test:cover": "nyc --reporter html --reporter text mocha --reporter dot test/*",
  "test": "npm run test:unit && npm run test:integration",
..
},