Editing Scripts in Package.json
- 09 Nov 2022
-
DarkLight
-
PDF
Editing Scripts in Package.json
- Updated on 09 Nov 2022
-
DarkLight
-
PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
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?