Appmixer Connectors
In the test
directory, you can find the test files for the connectors. They are not exhaustive as there is another set of tests that are not public.
npm run test-unit
In test/utils.js
you can find a stub for the Appmixer API. It is supposed to emulate all the advanced features of the Appmixer engine like sending messages, doing HTTP requests, using cache, etc. It is not a complete implementation of the Appmixer API, but it is enough to test the connectors. You can use it to test your connectors without having to run the Appmixer engine.
These tests run for each PR. They are also integrated into SonarQube analysis which is run on each commit to dev
branch.
Rule of thumb:
- a
receive
function in a component should be tested if it has any logic in it (caching, timeouts, bulk processing). If it is just a pass-through, it does not need to be tested. - a
routes.js
file should be tested if used for more complex tasks. For example processing incoming webhooks.