* refactor(github): separate pull request count service
Count all pull request badge variants through GitHub search so draft qualifiers can be composed consistently. Keep issue badges on the repository issues connection and document each preserved PR route explicitly.
Co-authored-by: Philippe Martin <phmartin@redhat.com>
* test(github): move pull request badge coverage
Keep the existing live picture checks with the service that now owns the pull request routes.
* test(github): cover pull request search variants
Assert the exact unfiltered GitHub search qualifier and preserve open, closed, raw, and non-raw badge rendering.
* test(github): cover draft pull request filters
Verify excludeDrafts, onlyDrafts, label composition, and closed raw rendering against exact GitHub search qualifiers.
* test(github): cover pull request request errors
Reject incompatible draft filters before an outbound request and keep missing repositories distinct from valid zero-count results.
* test(github): guard GraphQL response boundaries
Cover malformed pull request search data and prove issue badges remain on the repository issues query after the service split.
* fix(github): preserve unfiltered pull request counts
* test(github): use live pull request fixtures
---------
Co-authored-by: Philippe Martin <phmartin@redhat.com>
This will definitely save time, and ensure more uniformity.
It moves the `createServiceTester()` calls to a different place from where I'd like them, though I'm happy to have them checked by the linter.
Closes#2701
Fixes#2876 with @paulmelnikow's suggestion
Moved imports of `ServiceTester` and `createServiceTester` to a separate file so that dev dependencies are not imported by service classes.
Continue to implement #2698:
- Add `core/base-service/index.js` (but hold off on moving the things it imports)
- Add shortcuts in `services/index.js` for Base*Service, errors, and deprecatedService. This file will be streamlined later to avoid cluttering it with rarely used bits.
- Apply consistent ordering of imports and use of `module.exports` in testers.
- Remove some renaming of imports.
- Remove obsolete tests here and there.