Skip to content

Contradictory specs: traverse() on a missing node throws vs returns [] #18

Closed

Description

@michaeloboyle

Two existing tests specify opposite behaviour for traversal from a missing node:

  • tests/unit/Database.test.ts:746: expect(() => db.traverse(99999)).toThrow('Start node with ID 99999 not found')
  • tests/unit/TraversalQuery.test.ts:735: db.traverse(99999).out('LINKS').toArray() should return []

Database.traverse has thrown since cc29cb8 (2025-10-27), so the second test fails on main. One of the two specs has to change; this needs an owner decision, not a code fix.

Activity

  1. added
    bugSomething isn't working
    questionFurther information is requested
    on Nov 2, 2026
  2. michaeloboyle commented on Nov 2, 2026

    @michaeloboyle
    OwnerAuthor

    Ruled 2026-11-02 by @michaeloboyle: keep the error. db.traverse(missingId) throws Start node with ID <id> not found, as specified in tests/unit/Database.test.ts:746. The contradicting spec in tests/unit/TraversalQuery.test.ts now expects the same error (PR #19).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions