Skip to content

test: expand coverage for fonts, vector tiles, raster tiles, and style URLs - #2253

Open
navidnabavi wants to merge 3 commits into
maptiler:masterfrom
navidnabavi:test/expand-font-data-rendered-coverage
Open

test: expand coverage for fonts, vector tiles, raster tiles, and style URLs#2253
navidnabavi wants to merge 3 commits into
maptiler:masterfrom
navidnabavi:test/expand-font-data-rendered-coverage

Conversation

@navidnabavi

@navidnabavi navidnabavi commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add test/font.js: dedicated font endpoint tests covering /fonts.json listing, PBF content/body, Last-Modified header, 304 Not Modified + Cache-Control: no-cache bypass, and all 400 error cases
  • Expand test/tiles_data.js: GeoJSON format endpoint, TileJSON content + absolute URL validation, invalid format rejection
  • Expand test/tiles_rendered.js: HTTP caching (Last-Modified header, 304, no-cache bypass, stale date handling)
  • Add test/style_urls.js: style URL rewriting (sprite, glyphs, source URLs become absolute), /styles.json listing content, rendered TileJSON tileSize field (256 default + 512 explicit), listing endpoints (/rendered.json, /data.json) item content, /health body

Coverage delta

File Stmts Δ Branch Δ
serve_font.js +9.91% +22.22%
serve_data.js +3.43% +4.49%
serve_rendered.js +0.43% +2.17%
server.js 0 +0.87%
All files +0.70% +2.35%

Test plan

  • All 223 existing + new tests pass (npm test)
  • Pre-existing visual regression failure is unrelated (pixel diff on static-bearing-pitch fixture)
  • No new test files touch production code

navidnabavi and others added 2 commits June 4, 2026 04:02
Add dedicated test/font.js covering /fonts.json listing, PBF content,
Last-Modified header, 304/no-cache caching behavior, and 400 error cases.

Expand test/tiles_data.js with GeoJSON format endpoint, TileJSON content
and absolute URL validation, and invalid format rejection.

Expand test/tiles_rendered.js with HTTP caching tests: Last-Modified
header presence, 304 Not Modified, Cache-Control: no-cache bypass,
and stale If-Modified-Since handling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ON tests

Add test/style_urls.js covering:
- Sprite and glyphs URLs rewritten to absolute on style.json response
- Source tile URLs rewritten to absolute
- /styles.json items have absolute url field and list all configured styles
- Rendered TileJSON default tileSize (256) and explicit tileSize (512)
- /rendered.json and /data.json items have absolute tile URLs
- /health returns "OK" body

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread test/style_urls.js Fixed
Fix prettier formatting across tiles_data.js, tiles_rendered.js,
font.js, and style_urls.js. Replace chained .not.be.NaN expression
with Number.isNaN() call to satisfy no-unused-expressions rule.
Remove unused `names` variable in style_urls.js.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants