• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

hexojs / hexo-generator-feed / 286 / 1
99%
master: 99%

Build:
DEFAULT BRANCH: master
Ran 01 Jun 2020 03:02AM UTC
Files 2
Run time 0s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

01 Jun 2020 03:01AM UTC coverage: 100.0%. Remained the same
286.1

push

travis-ci-com

web-flow
feat: render absolute feed URLs (#143)

This PR is an update to #29.

This supposed to be a small PR, but I've encountered some issues regarding the base URL.

The `[full_url_for](https://github.com/hexojs/hexo-util/blob/master/lib/full_url_for.js#L27)` function expects the `config.url` not to end with a forward slash. Otherwise it will create a double slash URL, e.g. `http://example.com//atom.xml` (notice that a double slash replacement happens only _after_ the base URL).

I was wondering how the icon feature (#102) can be using `full_url_for` with the current code and not run into any double slash issues. The answer is: it doesn't handle this case. The [unit tests](https://github.com/hexojs/hexo-generator-feed/pull/102/files#diff-910eb6f57886ca16c136101fb1699231R240) are simply running against a custom base URL without an ending slash.

I've cleaned up the tests:
- removed the ending slash from the base URL
- adjusted and added new tests to handle subdirectories correctly (as specified in the [hexo documentation](https://hexo.io/docs/configuration.html#URL))
- hard-coded expected values - it makes a test more reliable and readable

20 of 22 branches covered (90.91%)

44 of 44 relevant lines covered (100.0%)

20.02 hits per line

Source Files on job 286.1
  • Tree
  • List 0
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 283
  • Travis Job 286.1
  • c164383b on github
  • Prev Job for on master (#281.1)
  • Next Job for on master (#295.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc