- 09 Nov 2022
-
DarkLight
-
PDF
Testing
- Updated on 09 Nov 2022
-
DarkLight
-
PDF
All Itential built adapters as well as adapters built by the Adapter Builder include test scripts. In most adapters, the dependencies required to run tests are regular dependencies and not devDependencies. This is because some of the adapter scripts for checking health and troubleshooting utilize the tests.
Test the adapter when you first install it to make sure it test clean. There are adapter base, unit, and integration tests that come with the adapter. You can run them together (npm run test). If however, there are errors during testing, you may want to run them separately. To run separately:
- adapter base test: npm run test:baseunit
- unit test: npm run test:unit
- integration test: npm run test:integration
The unit test includes a test to check that the adapter.js and pronghorn.json methods are in sync. This is a useful test to verify that tasks in IAP Automation Studio will be passing the right parameters into the adapter. This test can take a significant amount of time for large adapters (e.g. 5-10 minutes). There is additional information in the article on Key Unit Tests
The integration tests are run in stub mode and so they make use of any mock data that has been provided with the adapter. There is additional information in the article on Key Integration Tests
While testing errors are not always related to run time issues, fixing testing issues can often help you prevent run time issues from occurring.
As a best practice always make sure the adapter tests clean after making any code or configuration changes.
Note: If the adapter does not test properly, the adapter can have runtime issues with 1 or more calls to the other system.