Commit Graph

19 Commits

Author SHA1 Message Date
Naz
928ff629fd Published new versions
- @tryghost/express-dynamic-redirects@0.2.2
2021-11-29 17:45:22 +04:00
Naz
c25c409e60 Added edge case unit tests to DynamiRedirectsManager suites
refs https://github.com/TryGhost/Toolbox/issues/139

- These changes bring the module to 100% test coverage. No need to cover any more unless there are specific bugs uncovere!
2021-11-29 17:43:39 +04:00
Naz
c0b1ddfd3e Added subdirectory coverage to DynamiRedirectsManager suites
refs https://github.com/TryGhost/Toolbox/issues/139

- These unit tests come directly from equivalent regression tests in Ghost repository - fedbfb3c67/test/regression/site/redirects.test.js
- This changeset covers subdirectory use in incoming request
2021-11-29 17:30:53 +04:00
Naz
0daed36366 Added external URL coverage to DynamiRedirectsManager suites
refs https://github.com/TryGhost/Toolbox/issues/139

- These unit tests come directly from equivalent regression tests in Ghost repository - fedbfb3c67/test/regression/site/redirects.test.js
- This changeset covers redirects to external URLs
2021-11-29 17:20:45 +04:00
Naz
a6d86c85b6 Added case sensitivity coverage to DynamiRedirectsManager suites
refs https://github.com/TryGhost/Toolbox/issues/139

- These unit tests come directly from equivalent regression tests in Ghost repository - fedbfb3c67/test/regression/site/redirects.test.js
- This changeset covers case sensitivity cases in regexes
2021-11-29 17:15:14 +04:00
Naz
08e2056f6c Extracted duplicate class initialization in test suite
refs https://github.com/TryGhost/Toolbox/issues/139

- The DynamicRedirectManager was initialized witht the same set of parameters throughout the test suite, so it made sense to initialize it once for all the tests. The sibiling describe block will have a similar setup for a redirects manager that has a subdirectory configured
2021-11-29 16:31:40 +04:00
Naz
77e2d550c8 Extracted duplicate declarations from test suite
refs https://github.com/TryGhost/Toolbox/issues/139

- As few more tests have been added a clearer pattern of reusable variable has emerged. Have extracted common bits into "beforeEach" block to keep the declarative part of the test to the minimum
2021-11-29 16:23:52 +04:00
Naz
6d51cef41b Added unit test coverage to DynamicRedirectManager
refs https://github.com/TryGhost/Toolbox/issues/139

- These unit tests come directly from equivalent regression tests in Ghost repository - fedbfb3c67/test/regression/site/redirects.test.js
2021-11-29 16:13:29 +04:00
Naz
eb6d1b208a Made options parameter optional
refs https://github.com/TryGhost/Toolbox/issues/139

- The options parameter doesn't have to be passed in as there is handling for a default value in place - "permanent = false"
2021-11-29 16:08:03 +04:00
Fabien O'Carroll
93a37f98be Published new versions
- @tryghost/domain-events@0.1.3
 - @tryghost/express-dynamic-redirects@0.2.1
 - @tryghost/magic-link@1.0.14
 - @tryghost/member-analytics-service@0.1.4
 - @tryghost/member-events@0.3.1
 - @tryghost/members-analytics-ingress@0.1.5
 - @tryghost/members-api@2.4.0
 - @tryghost/members-csv@1.1.8
 - @tryghost/members-importer@0.3.4
 - @tryghost/members-ssr@1.0.15
 - @tryghost/members-stripe-service@0.3.1
 - @tryghost/members-offers@0.8.0
 - @tryghost/members-payments@0.1.0
2021-10-21 15:44:21 +02:00
Renovate Bot
7a68dc2bd3 Update dependency mocha to v9.1.3 2021-10-20 13:45:40 +00:00
Daniel Lockyer
cc73c4585a Added codecov.io coverage uploader to CI
refs linear.app/tryghost/issue/CORE-74/improve-the-test-situation

- this commit adds the codecov GitHub Action into CI so we can upload
  coverage reports
- the coverage files need to be in XML for them to work with
  codecov, so this commit also adds cobertura (XML) as a reporter
2021-10-20 13:48:54 +02:00
Naz
8b271835d2 Published new versions
- @tryghost/express-dynamic-redirects@0.2.0
2021-10-12 17:26:29 +02:00
Naz
4da8051114 Fixed tests
refs https://linear.app/tryghost/issue/CORE-84/have-a-look-at-the-eggs-redirects-refactor-branch
refs c44e33b1f7

- Previous commit didn't adjust unit tests to the new constructor API
2021-10-12 17:25:52 +02:00
Naz
c44e33b1f7 Simplified DynamicRedirectManager's constructor interface
refs https://linear.app/tryghost/issue/CORE-84/have-a-look-at-the-eggs-redirects-refactor-branch

- There is no need to pass in whole "urlUtils" instance to construct the class as all the class has to know is how to construct a "subdirectory URL" which can be a single function passed in instead of a vague object instance
2021-10-12 17:21:46 +02:00
Naz
ba2a5df493 Added handling for invalid redirect regexes
refs https://linear.app/tryghost/issue/CORE-84/have-a-look-at-the-eggs-redirects-refactor-branch
refs 8f5186995d
refs 260a47da83

- The router should not stop working when an invalid redirect definition is added
- Referenced commits solve this exact problem before this module was introduced
2021-10-12 17:21:46 +02:00
Naz
80f2a001ec Simplified DynamicRedirectManager's constructor interface
refs https://linear.app/tryghost/issue/CORE-84/have-a-look-at-the-eggs-redirects-refactor-branch

- In most of the packages we follow the pattern of passing in a single "options" object into a constructor and desructuring those the object into parameter, like this example: 077c83dc2d/packages/limit-service/lib/limit-service.js (L19-L26)
2021-10-12 17:21:46 +02:00
Fabien O'Carroll
a438795d4a Published new versions
- @tryghost/express-dynamic-redirects@0.1.0
2021-09-29 12:02:26 +02:00
Fabien 'egg' O'Carroll
8c92f5744c Added express-dynamic-redirects module (#337)
refs https://github.com/TryGhost/Team/issues/1091

The Offers feature needs to be able to add and remove redirects to Ghost
- which is very similar to the custom redirects functionality. Here we've
pulled out the core of the dynamic redirect part of custom redirects so
that it can be used by both features and have code shared between them.
2021-09-29 12:01:40 +02:00