Skip to content

ci: add a server boot smoke test (would have caught #117) #133

Description

@sacha-l

From investigating #117's bad merge that broke prod for ~10 min.

Severity: nit (process hardening)

File(s): server/tests/ (new file)

Why: vitest currently tests handlers, repositories, and verifiers in isolation. None of the 248 tests imports server.js end-to-end, so a route mounting an undefined controller method passes CI but crashes Railway at boot.

Suggestion: add a 1-test file that does:

import { describe, it, expect } from 'vitest';

describe('server bootstrap', () => {
  it('imports server.js without throwing', async () => {
    // Just resolving the module exercises every route mount + middleware
    // declaration; a route referencing an undefined handler throws here.
    await import('../server.js');
    expect(true).toBe(true);
  }, 5000);
});

Would have caught #117 before merge. Probably need to skip the actual app.listen (set an env flag) so the test doesn't bind a port.

🤖 Generated with Claude Code

Activity

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

    claude-suggestedIssue suggested by the Claude agent during a /ship-issue run

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions