HarborClient snippet bundle with pass and fail post-request tests.
Snippets
Both snippets run in post-request script lists (collection or request PostRequest tab).
| Snippet |
Purpose |
| Pass |
Asserts a successful response. Use against endpoints that are meant to succeed. |
| Fail |
Asserts a error response (expects 400). Use against endpoints meant to fail. |
Install
Requires HarborClient 2.0.0 or later.
- Open File → Snippets.
- Browse the Marketplace tab and install Testing, or use Install with this repository URL:
https://github.com/harborclient/snippet-testing
- Installed snippets appear under Settings → Snippets and can be referenced from any post-request script list via Select snippet....
See Testing and Request scripts — Snippets in the HarborClient docs for more on writing and using tests.
Development
pnpm install
Sign the bundle directory with an Ed25519 key:
export HARBORCLIENT_PLUGIN_SIGNING_KEY=/path/to/signing.pem
pnpm sign
Publish a new version (bumps snippets.json, signs, commits, tags, and pushes):
pnpm release
pnpm release -- --version minor
See the @harborclient/sdk signing docs for key generation and signature.json format.