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

@aehrc/questionnaire-test-toolkit

v0.1.0

Published

Behavioural test toolkit for FHIR Questionnaire forms: DOM interaction helpers and a renderer harness.

Readme

@aehrc/questionnaire-test-toolkit

Behavioural test toolkit for FHIR Questionnaire forms: DOM interaction helpers plus a harness that mounts a questionnaire in the renderer, optionally pre-populated from a patient.

Extracted from apps/smart-forms-app/src/test/ so that a form's test suite can live beside the form rather than inside the application. Consumed by the Aboriginal and Torres Strait Islander Health Check suite in this repository.

The contract

src/index.ts is the public API. Everything re-exported there may be relied upon by a form's test suite. Anything else is internal: which file a helper lives in, how it locates elements, and any function added to a source file without being re-exported from index.ts.

Re-exports are named individually rather than export *, so adding a helper to a source file is not the same act as promising it to consumers.

Consume it as @aehrc/questionnaire-test-toolkit, never by relative path — that keeps a later move to a separate repository a path rewrite rather than a rebuild.

Built, not consumed as source

main, module, types and exports point at dist/, produced by tsup in dual ESM/CJS with declarations — the same build the other published packages in this repository use.

An earlier revision shipped src/index.ts directly, on the grounds that every consumer already transforms TypeScript. That holds only inside this repository: Vitest does not transform node_modules by default, and the app's transformIgnorePatterns (/node_modules/(?!(@aehrc|@fontsource)/)) is a Jest config here that does not travel with the package. An external consumer would have imported raw TypeScript and failed.

Run npm run build -w packages/questionnaire-test-toolkit after a fresh npm ci. The workspace symlink now resolves to a package whose dist/ does not exist until it is built.

React, the renderer, TanStack Query and both testing libraries are left external, so a consumer never gets a second copy of React or of renderer state. @types/fhir is a dependency and @types/react a peer because both appear in the emitted declarations (fhir/r4 for Patient and Questionnaire, react/jsx-runtime for the wrapper's return type).

Notes for maintainers

Seven helpers are not exercised by any suite in this repository. inputFile, inputTime, inputReference, inputUrl, chooseQuantityOption, inputOpenChoiceOtherText and getAnswerRecursiveByLabel are unused by the Aboriginal and Torres Strait Islander Health Check suite. They are kept because this file began as a copy of packages/smart-forms-renderer/src/stories/testUtils.ts, where the storybook stories do use them, and because the toolkit is meant to be general rather than shaped around its current tenant. Treat them as untested surface.

terminologyServerUrl is load-bearing — do not remove it. BehavioralTestWrapper passes it to buildForm unless the consumer overrides it through the prop of the same name, and apps/smart-forms-app/src/test/aboriginalFormExtraction.test.tsx compares the requested server URL against this exact value, forwarding matches to the real Ontoserver. Changing or deleting it breaks that suite. (An earlier revision of this file called it "probably dead" on the grounds that every suite mocks fhirclient to return {}. That is untrue of the file above, which is the one place the constant has an observable effect.)

The input helpers use fireEvent, which cannot see readOnly, disabled or pointer-events. A test written with them can therefore assert an interaction a real user cannot perform: a click on a read-only control is a silent no-op, and inputText writes into a read-only field successfully. Both have been observed in practice. If a test passes but the behaviour looks impossible, check whether the item or an ancestor is readOnly before trusting the green.

A near-duplicate exists. packages/smart-forms-renderer/src/stories/testUtils.ts is a longer copy of the same helpers, despite a comment in the original asserting the two are identical. Merging them is worthwhile and deliberately out of scope here.