> Unpopular opinion, but I always say that unit tests are contracts for the API
You’re talking about integration tests or e2e tests.
Those don’t sound like unit tests.
You’re talking about integration tests or e2e tests.
Those don’t sound like unit tests.
Or to put it a different way, your unit tests should cover units that have a good boundary to the rest of the system. This should sound like a module, but there is reason to have module as a larger thing than your unit (most of the time there shouldn't be, but once in a while this is useful), and so while there is overlap it is often useful to consider them different.
Integration tests cover the API, but they do not test the API (well they often use some API as well, but the won't cover all your internal APIs.)