npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@loopstack/testing-examples

v0.2.1

Published

Workflow testing examples — runWorkflow in-process tests, scripted HITL answers, tool unit tests with testTool, and record/replay fixtures.

Readme


title: Testing Examples description: Runnable workflow-testing examples for Loopstack — runWorkflow() in-process workflow tests with scripted HITL answers, parkView() park assertions, coverage() gates, testTool() tool unit tests, fixture auto record/replay, and createContractFake() DI fakes. Companion package to the Testing guide.

@loopstack/testing-examples

Runnable testing examples for the Loopstack automation framework — the patterns from the Testing guide and Testing Methodology as working code.

The example under test is a small deterministic triage flow (src/triage/): a classify_ticket tool grades a support ticket, the workflow presents the severity as a yes/no approval prompt, then waits for the human decision. No LLM — the whole flow is deterministic, so every test is exact.

Scenarios are named for the acceptance criterion they check (it('C1: …')), so the test report reads as a criteria matrix — the discipline from the methodology guide.

What each spec demonstrates

| Spec | Pattern | | ------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | classify-ticket.tool.spec.ts | Tool unit testtestTool().forTool(...), assert on the envelope data (the resultSchema is validated by call()) | | triage-ticket.workflow.spec.ts | In-process workflow testrunWorkflow() with scripted answers; outcome assertions on status/path/result/document(); parkView() for the human touchpoint; a coverage() gate closing the suite | | triage-ticket-replay.spec.ts | Record/replay — the fixture: option (auto record/replay, CI-guarded) as the default, plus an inline replay() fixture for fully-scripted determinism | | triage-ticket-contract-fake.spec.ts | Contract fakecreateContractFake() substitutes the tool with a resultSchema-validated response and asserts how the workflow called it |

Run them:

npm test

Recording fixtures from live runs

The fixture: option records a fresh fixture when the file is missing and replays it when present. Record one from a real run:

npm run start:dev                                    # start the backend
loopstack run triage_ticket --arg text="Production is down!" --trace
loopstack runs <run-id> --record src/triage/__tests__/__recordings__/triage.json

Replay is transition-scoped: recordings are matched by the transition they were captured in, then consumed in sequence. Each entry's metadata (tool, workflow, transition, args, and config when present) is asserted against the actual call — when the outgoing args or config drift from the recording the run fails with a drift error naming the tool and both values, the signal to re-validate live and re-record. In CI a missing fixture is an error (not a silent live run) unless LOOPSTACK_RECORD=1 is set.

About

Author: Jakob Klippel

License: MIT