Skip to content

ECSoC_2026: Restore backend test runner and importable Express app #194

Description

@Babin123456

Problem

The repository contains backend tests, but npm test does not run them and server.js cannot be imported cleanly.

Current Behavior

npm test exits with the default placeholder error. Existing tests expect a createApp factory, but the backend starts immediately and exports nothing.

Why This Improvement Is Needed

Maintainers cannot verify backend behavior before merging API changes. This increases regression risk for URL scanning, scam detection, retry handling, and error responses.

Proposed Solution

Refactor server.js to expose createApp(options), keep direct node server.js startup behavior, and wire npm test to Node's built-in test runner.

Expected Outcome

Backend routes can be tested deterministically with injected API keys and mock fetch implementations.

Additional Notes

This keeps runtime compatibility while making the backend maintainable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions