* feat(tests): add comprehensive unit tests for various utility functions and views
- Implement tests for cache utility to ensure proper behavior with no cache and TTL keys.
- Add tests for common utilities including string manipulation and path handling.
- Introduce tests for directory import functionality to validate file imports and pattern matching.
- Create tests for git hash retrieval to handle fallback scenarios.
- Develop tests for deprecated got utility to verify response handling and retry logic.
- Enhance got utility tests to include request hooks and search parameter handling.
- Mock header generator tests to validate user agent handling.
- Expand helpers tests to cover current path retrieval and duration parsing.
- Implement tests for ofetch utility to ensure proper proxy handling and logging.
- Add OpenTelemetry metric tests to validate metric serialization.
- Create proxy tests to verify multi-proxy selection and failure handling.
- Introduce request rewriter tests to validate fetch and get wrapper functionality.
- Add timezone utility tests to handle various input types.
- Implement view tests for Atom and RSS rendering to ensure correct output.
- Create index view tests to validate debug information display based on configuration.
* refactor: remove deprecated got implementation and associated tests
* test: expand coverage for api, middleware, and utils
- Adjusted expected values in error handling tests to reflect updated application behavior.
- Increased timeout for Puppeteer tests from 20 seconds to 45 seconds to accommodate longer loading times.
- Introduced a new CaptchaError class to handle captcha-related errors.
- Updated the dynamic route to throw CaptchaError when encountering specific error codes.
- Added tests for CaptchaError to ensure proper error handling in the API.
* test: fix tests
* revert "fix: fill image from itunes_item_image (#16694)"
This reverts commit 879772a97f.
* fix: fill image from jsonfeed template
* chore: bump msw to 2.4.3
* feat(core/utils/wechat-mp): major rewrite
* Support more `item_show_type`: `APP_MSG_PAGE`, `VIDEO_SHARE_PAGE`,
`AUDIO_SHARE_PAGE`, and `IMG_SHARE_PAGE`. Previously only the first one
could be parsed properly. There are still some other known types waiting
for live examples for further adaptation. If this is the case, a
fallback method will try to generate entries using mostly OpenGraph
metadata. Meanwhile, the administrator of self-hosted instances will see
warnings in the log, asking them to report the URL as a new live
example. Still, `VIDEO_SHARE_PAGE` explicitly uses the fallback method
without any warning, as there is no possible approach to generate a
video/iframe URL from page metadata.
* Show audio and videos in `APP_MSG_PAGE`. However, not all videos
can be shown due to the same reason as `VIDEO_SHARE_PAGE`.
* Show the location where the article is sent.
* Some bugs, mostly due to outdated cheerio selector, are fixed.
* Add a new sub-route `wechat-mp` to `/test` to make things easier.
* All changes are well-tested.
Signed-off-by: Rongrong <i@rong.moe>
* style(core/utils/wechat-mp): fix ESLint & CodeQL errors
Signed-off-by: Rongrong <i@rong.moe>
* style(core/utils/wechat-mp): fix a DeepScan issue
Signed-off-by: Rongrong <i@rong.moe>
* style(core/utils/wechat-mp): fix ESLint error
Another try w/ pre-commit hook disabled.
Signed-off-by: Rongrong <i@rong.moe>
---------
Signed-off-by: Rongrong <i@rong.moe>
* fix: use :param{.+} instead of :param+ for hono
* fix: use two separate routes to simulate :param* in hono
It seems that hono does not support this route syntax. We can simulate
it via two separate routes.
See https://github.com/orgs/honojs/discussions/1536
* fix: use {} instead of () for regex in hono
* fix: revert changes to lib/router.js as it's still using koa router
* Revert "fix: use two separate routes to simulate :param* in hono"
This reverts commit b00a0a74a025939d0a59c3f8f7b3b7038c13f715.
* fix: use :param{.+}? to simulate :param*
* feat: add hint about trailing slash in error message