I am working on a node project which consists of a core package and several addon packages. For the end product to work, the core package and atleast one of the addon packages should be integrated. These addon packages are basically database adapters. Addon packages have a production dependency on the core package. All the packages are planned to be distributed as separate npm packages.
I can do unit tests and test functionality of all components separately. But for me, integration tests are important and they test against a real database. I should be able to put together the core and addons, to test them in integration.
The question is, in which package should I do the integration test?
Do the tests in the addon packages. This seems the most 'right' and it is the first thing I thought. However, since the functionality of each addon is very similar, the tests are also similar. Implementing hundreds of similar tests for each of them will bring code duplication.
Do the tests in the core package. This will definitely remove code duplication. But it will cause a development dependency from the core to the addons. Also if a new addon is to be implemented, it will cause the core test suite to change?
Create a separate package just for integration testing. This will prevent code duplication. But it is something I have never seen an example of. Also, adding addons will cause this package to change.