Commit Graph

10 Commits

Author SHA1 Message Date
Simon Backx
0292b4868b Reduced minimum required test coverage for functions
refs https://ghost.slack.com/archives/C02G9E68C/p1657607789883059?thread_ts=1657522575.865029&cid=C02G9E68C

Tests are failing because of the minimum required test coverage for functions. We'll need to fix it up later.
2022-07-12 10:24:02 +02:00
Daniel Lockyer
c50658953c Renamed API canary/ folder to endpoints/
- now we only have one API version, it doesn't make sense to keep
  "canary" around
- renaming it to `endpoints/` makes more sense for this
- this commit renames the `core/server/api/canary/` folder to
  `core/server/api/endpoints/`
- it also fixes the naming in test titles and the various other places
  we relied on this
2022-07-04 11:14:37 +02:00
Hannah Wolfe
a4a9ba7940
🔥 Removed versioned APIs
refs: https://github.com/TryGhost/Toolbox/issues/229

- we are getting rid of the concept of having multiple api versions in a single ghost install
- removed all the code for multiple api versions & left canary wired up, but without the version in the URL
- TODO: reorganise the folders so there's no canary folder when we're closer to shipping
        we need to minimise the pain of merging changes across from main for now
2022-04-28 15:37:09 +01:00
Hannah Wolfe
6e92229a07 Remapped member.subscribed value using newsletter subscriptions (#14563)
refs https://github.com/TryGhost/Team/issues/1545

- Remapped `member.subscribed` value based on newsletter subscriptions in API output
- Enabled filtering by subscribed status for multiple newsletters

Co-authored-by: Matt Hanley <git@matthanley.co.uk>
2022-04-26 12:31:34 +01:00
Hannah Wolfe
1db7ccc212
Updated minimum coverage percentages
- Over the last month we've managed to increase coverage by a few %
- Update the minimum values so we don't accidentally reduce it again
2022-03-29 15:51:46 +01:00
Hannah Wolfe
e24209a84f
Changed c8 reporter html -> html-spa
- I might be the only person who uses these, but I like to dig into coverage reports so I can see where we've got holes
- In Ghost the reports is huge and unweildy, and it's hard to see what coverage is like for components grouped by folders
- html-spa reporter fixes this, it makes a beautiful nested tree view, but you can also switch to flat
- it's so much more useful for working on coverage in an area of the codebase!
2022-03-09 14:18:34 +00:00
Hannah Wolfe
3bd8e01495 Pinned coverage to current levels to prevent drops
- Updating our config to have `--check-coverage` enforces that the coverage meets a certain level.
- The default is 95 I believe, but our coverage is lower.
- I've set the levels to our current levels, so any drop below these numbers will cause the build to fail.
- I've also set the reporters to be text, html and cobertura so we always have a mini report, the full HTML files to navigate and cobertura for CI
- Cleaned up CI so we don't use the cov:unit command as we're now using codecov
- This also means we can remove the cov:unit command which was weird to use because it uses the last test run, which can be confusing
2022-02-24 09:56:06 +00:00
Hannah Wolfe
b684f3636e
Added more files to c8 excludes
There are some files we don't expect _unit_ tests for - they are e2e tested and tracking that is a different problem!
- express routes and wiring files
   - this does not count middleware. Middleware functions should be fully unit tested
- previous API version files
- canary api endpoint configuration files
   - this does not count api utils, valiation and serialisation which can be unit tested
2021-11-16 15:53:08 +00:00
Sam Lord
1234a61b52 Mode c8 configuration from package.json to .c8rc.json
refs: https://github.com/TryGhost/Toolbox/issues/117

Simplifies the commands in package.json by adding defaults to the .c8rc.json file
2021-11-16 10:22:15 +00:00
Sam Lord
0f53e23763 Configured c8 to exclude frontend and migrations from coverage
refs: https://github.com/TryGhost/Toolbox/issues/117

Adding a basic configuration to the unit test coverage tracking to
ignore irrelevant files.
2021-11-16 09:53:32 +00:00