Skip to content

[Feat]: Node.js sample behavioral test suite on the #126 CI lane (offer) #136

Description

@vishkaty

Context

#126 gave the Node.js sample a real CI lane (build + npm test on every touching PR) — which makes broader test coverage actually enforceable for the first time. Right now the suite behind it is three files (discovery.test.ts, validation.test.ts, discount.test.ts), while the Python server has a full behavioral suite covering the checkout lifecycle (create/update/complete/cancel), fulfillment selection, payment failure paths, idempotency, and inventory validation.

That asymmetry means a regression in the Node.js server's checkout flow currently ships green.

Offer

I'd like to contribute a Node.js behavioral test suite mirroring the Python server's coverage, running on the #126 CI lane:

  • checkout lifecycle: create → update → complete, plus cancel and post-completion immutability
  • fulfillment: option selection and completion-without-fulfillment rejection
  • validation: out-of-stock and unknown-product paths (create and update)
  • idempotency: same-key replay and same-key/different-body conflict

Structured per-area like the existing three files, same vitest conventions, no new dependencies.

Asking first per the contribution flow: is this welcome, and do you have preferences on scope or structure before I start? Happy to split it into a few small PRs (one area each) rather than one large one if that reviews easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions