Skip to content

test(examples): add invalid-request proof to the HTTP JSON summary smoke #363

@gregkonush

Description

@gregkonush

Outcome

Extend the HTTP JSON summary example so it proves both the successful WorkPaper-backed response and one invalid request path.

Likely files

  • examples/headless-workpaper/http-json-summary.ts
  • examples/headless-workpaper/README.md only if the expected output text changes

Suggested approach

The example already starts a local HTTP server, posts valid opportunity records, and asserts the computed JSON summary. Add one small invalid request check while the server is running, such as posting a non-array JSON body to /summary, and assert that the response status is 400 with a clear error string.

Keep the example deterministic and avoid adding dependencies.

Acceptance proof

Run:

cd examples/headless-workpaper
npm run http-json-summary

The script should still print the successful summary, and it should throw if the invalid request does not return the expected 400 error response.

Scope check

  • Do not change the public success output unless necessary.
  • Do not turn the example into a web framework demo.
  • Keep the added assertion small and readable for someone new to the repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: examplesRunnable examples and external consumer smoke coveragefirst-timers-onlyReserved for someone making their first contribution to this projectgood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No type
    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