Editing Scripts in Package.json
  • 09 Nov 2022
  • Dark
    Light
  • PDF

Editing Scripts in Package.json

  • Dark
    Light
  • PDF

Article Summary

Usually you do not want to make changed in the package.json, however, when you are attempting to debug an issue, 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 and the response it receives when it is logging debug level logs. Thus, when you are having issues it is often a good idea to run your tests in debug mode.
  • The adapter logs every step it takes in trace mode. This is often too chatty to be useful so it should only be used to isolate what part of the adapter is having issues and you can not determine what part like when the adapter appears to be hung.

At the end of the test scripts in the package.json you will see --LOG=error. This sets the log level used in the test script to error by default. You can change it to warn, info, debug, or trace to get additional logs during testing.

Example: package.json

"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",
..
},

Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.