-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Updated how we handle the koa-router nuance of wildcard routes #2588
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2588 +/- ##
==========================================
- Coverage 97.23% 97.18% -0.05%
==========================================
Files 291 291
Lines 45932 45932
==========================================
- Hits 44661 44639 -22
- Misses 1271 1293 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
function getPathToRegexpVersion() { | ||
let pathToRegexVersion | ||
try { | ||
;({ version: pathToRegexVersion } = JSON.parse( | ||
fs.readFileSync(`${__dirname}/node_modules/path-to-regexp/package.json`) | ||
)) | ||
} catch { | ||
pathToRegexVersion = '6.0.0' | ||
} | ||
return pathToRegexVersion | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely ridiculous that this is necessary.
… routes (newrelic#2588)" This reverts commit 544c9e7.
Description
Both
koa-rotuer
and@koa/router
13.0.1 usepath-to-regexp@8
but@koa/router
released 13.1.0 and downgradedpath-to-regexp@6
. This PR updates how we determined how to defined wildcard routes by keying off the version ofpath-to-regexp
when present. If it is not present assume the legacy behavior.How to test
I suspect they remedy this version mismatch of
path-to-regexp
between 13.0.1 and 13.1.0. I filed an issue here