0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/server/web/shared/middlewares
Naz 0962b3ed45 Made custom-redirects middleware testable
refs https://linear.app/tryghost/issue/CORE-35/refactor-route-and-redirect-settings
refs 7528ec8c3b

- The way the custom redirects middleware was organized made it extremely hard to unit test it (had to stub the redirects service methods etc). With a new organization it's possible to provide needed redirects configs to the method which makes the actual redirects Router logic testable and the code less coupled with redirects services
- This was meant to be an attempt to extract more of the slow redirects regression tests, which failed. Instead found this weak spot that could be improved and gained:
- shaved 4s of time as two slow regression test cases are now gone
- there's now a base to build upon when getting more coverage for the custom redirects middleware
2021-09-28 22:00:32 +02:00
..
api Change to use @tryghost/logging 2021-06-15 15:59:11 +01:00
brute.js Added userAuth brute middleware to members auth endpoint (#13152) 2021-07-19 09:40:38 +01:00
cache-control.js
custom-redirects.js Made custom-redirects middleware testable 2021-09-28 22:00:32 +02:00
error-handler.js Corrected deprecation comment 2021-07-02 13:50:11 +04:00
index.js Removed non-existent labs file export 2021-08-13 13:41:38 +01:00
maintenance.js
pretty-urls.js Swapped to American English spellings 2021-06-09 16:39:06 +01:00
uncapitalise.js
url-redirects.js Switch to @tryghost/debug, remove ghost-ignition 2021-06-15 17:24:22 +01:00