Skip to content

test: integration tests for NIP-11 relay information document #508

Closed

Description

@chappie-daemon

Summary

NIP-11 defines that a relay must respond to HTTP GET requests on / with Accept: application/nostr+json by returning a JSON document describing the relay. This is the only HTTP endpoint with zero integration test coverage.

What to test

  • HTTP GET / with Accept: application/nostr+json → 200 response with JSON containing name, description, pubkey, supported_nips, software, version
  • supported_nips array includes the NIPs declared in package.json (supportedNips)
  • HTTP GET / without Accept: application/nostr+json → returns HTML or non-JSON response (not the relay info doc)
  • WebSocket upgrade on / still works (the HTTP and WS handlers coexist on the same port)

Relevant code

  • src/handlers/request-handlers/root-request-handler.ts
  • src/routes/index.ts
  • package.json — supportedNips

Suggested location

test/integration/features/nip-11/nip-11.feature

Activity

  1. Anshumancanrock commented on Apr 18, 2026

    @Anshumancanrock
    Contributor

    @phoenix-server please assign

  2. kanishka0411 commented on Apr 19, 2026

    @kanishka0411
    Contributor

    Hi! I’d like to work on this :-)
    I’ll add the NIP-11 integration tests, and I also noticed a small bug in root-request-handler.ts where max_filters is mapped to maxFilterValues instead of maxFilters.I can include that fix in the same PR, or split it into a separate PR if you prefer.

  3. cameri commented on Apr 19, 2026

    @cameri
    Owner

    thanks @kanishka0411 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

testUnit or integration test improvements

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions