Skip to content

Add unit tests to the project #68

@webbpinner

Description

@webbpinner

Feature Request

The project currently has minimal test coverage (test/example.test.js and test/api_keys.test.js). This issue tracks expanding unit test coverage across the codebase.

Background

The project uses @hapi/lab as the test runner and @hapi/code for assertions. lib/server.js provides an init() helper for spinning up a test server instance without starting it, which is the correct pattern for route-level testing.

Tests are run with:

npm run start-test

Proposed Scope

  • Route handlers (routes/api/v1/) — covering CRUD operations, auth/scope enforcement, and edge cases
  • Python aux data manager framework (misc/) — builders, cleaners, and the runner
  • Shared JS utilities (lib/utils.js, lib/validations.js)

Notes

  • Tests run against sealogDB_devel (development database), which is rebuilt on each start-devel run
  • A CI step to run tests automatically on PRs would complement this work

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions