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

@patrikelfstrom/apsrt

v0.0.2

Published

Automated Property-based Snapshot Regression Testing

Readme

APSRT

Automated Property-based Snapshot Regression Testing

APSRT is a TypeScript tool for automated regression testing. It analyzes exported functions, generates property-based input samples from their types, and snapshots the results through Vitest.

Usage

Install APSRT in the project you want to test:

npm install --save-dev @patrikelfstrom/apsrt

Or run it without adding it to package.json:

npx @patrikelfstrom/apsrt

By default it will use your local tsconfig.json.

# Use a specific tsconfig file
npx apsrt --tsconfig tsconfig.app.json

# Update snapshots
npx apsrt --update

# Watch for changes and re-run tests
npx apsrt --watch

Snapshots are stored in .apsrt/__snapshots__/runtime.test.js.snap inside the project you run APSRT from.

If APSRT detects a likely nondeterministic function such as one using Math.random(), it will stop and ask you to add an @apsrt-ignore annotation to that export.

Developer

Clone the repository and install dependencies:

git clone [email protected]:PatrikElfstrom/apsrt.git
cd apsrt
npm install

Common development commands:

npm run build
npm test
npm run typecheck

Features

  • Generates runtime snapshot tests for exported TypeScript functions
  • Uses fast-check to create deterministic sample inputs
  • Uses Vitest snapshots to detect regressions
  • Uses ts-morph and the TypeScript compiler to inspect function signatures

How it works

  1. APSRT loads a TypeScript config file from the current working directory.
  2. It analyzes included .ts files and finds exported functions.
  3. It creates input arbitraries based on parameter type text.
  4. It runs each exported function with deterministic samples.
  5. It snapshots the collected input/output pairs.

Project Structure

  • src/ - CLI entry, packaged runtime entry, and core implementation
  • src/core/ - Type analysis, arbitrary creation, cache, and config loading
  • test/unit/ - Direct unit tests for core modules
  • test/integration/ - Fixture-based runtime flow coverage
  • test/fixtures/ - Sample exported functions used as test inputs

Environment Variables

  • APSRT_TSCONFIG: overrides the TypeScript config file name to load
  • APSRT_ENABLE_CACHE=false: disables the on-disk analysis cache

Tech Stack

License

MIT