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

@testfn/core

v0.0.2

Published

Comprehensive self-hosted testing platform

Readme

TestFn

Comprehensive self-hosted testing platform for developers

License: MIT Version

Overview

TestFn is a developer-first testing solution that combines test execution, analytics, and visual testing into a single self-hosted platform. It provides a unified interface for running tests across multiple frameworks (Vitest, Playwright, Jest) with built-in analytics, flaky test detection, and visual regression testing.

Features

Multi-Framework Support: Vitest, Playwright, Jest, Puppeteer
Test Analytics: Built-in metrics, flaky detection, performance regression
Visual Testing: Screenshot comparison and diff visualization
Self-Hosted: No external dependencies, runs completely offline
Storage Options: IndexedDB, filesystem, or custom database adapters
Parallel Execution: Run tests in parallel for faster feedback
Multi-Browser: Test across Chromium, Firefox, and WebKit

Installation

npm install testfn

Quick Start

Basic Usage

import { testFn } from 'testfn';

const runner = testFn({
  framework: 'vitest',
  testPattern: './tests/**/*.test.ts',
  parallel: 4
});

await runner.run();

With Storage

import { testFn } from 'testfn';

const runner = testFn({
  framework: 'playwright',
  testPattern: './e2e/**/*.spec.ts',
  storage: {
    type: 'indexeddb',
    dbName: 'my-app-tests',
    retentionDays: 30
  }
});

const results = await runner.run();
console.log(`Pass rate: ${results.summary.passed / results.summary.total}`);

Multi-Browser Testing

import { testFn } from 'testfn';

const runner = testFn({
  framework: 'playwright',
  browsers: ['chromium', 'firefox', 'webkit'],
  parallel: 6,
  storage: {
    type: 'indexeddb',
    dbName: 'cross-browser-tests'
  }
});

await runner.run();

Configuration

TestFnConfig

interface TestFnConfig {
  framework: 'vitest' | 'playwright' | 'jest' | 'puppeteer';
  testPattern?: string | string[];
  parallel?: number | 'auto';
  timeout?: number;
  retries?: number;
  env?: Record<string, string>;
  browsers?: BrowserType[] | BrowserConfig[];
  storage?: StorageConfig;
  visual?: VisualTestConfig;
  reporters?: Reporter[];
  onProgress?: (progress: TestProgress) => void;
  onComplete?: (results: TestResults) => void;
}

Storage Configuration

interface StorageConfig {
  type: 'indexeddb' | 'file' | 'db';
  dbName?: string;
  adapter?: unknown;
  retentionDays?: number;
}

API Reference

testFn(config: TestFnConfig): TestRunner

Creates a new test runner instance with the specified configuration.

TestRunner

async run(): Promise<TestResults>

Executes the test suite and returns results.

setAdapter(adapter: TestFrameworkAdapter): void

Sets a custom framework adapter.

TestStorage

async saveRun(run: TestRun): Promise<void>

Saves a complete test run to storage.

async getRecentRuns(limit: number): Promise<TestRun[]>

Retrieves the most recent test runs.

async getTestHistory(testId: string, limit: number): Promise<TestResult[]>

Gets historical results for a specific test.

Project Status

Version: 0.1.0 (V0 Implementation)
Status: Active Development

Implemented Features

  • ✅ Core type system (248 lines)
  • ✅ IndexedDB storage layer with retention
  • ✅ Test runner with parallel execution
  • ✅ Worker pool for true parallelism
  • ✅ Retry logic with automatic retries
  • ✅ Framework adapters: Vitest, Playwright, Jest
  • ✅ Multi-browser testing (Chromium, Firefox, WebKit)
  • ✅ Analytics engine (metrics, flaky detection, regressions)
  • ✅ Visual testing with pixel diff
  • ✅ Reporters: Console, JSON, HTML Dashboard
  • ✅ Storage facade with CRUD operations
  • ✅ 5 comprehensive examples

In Progress

  • 🚧 SSIM visual comparison
  • 🚧 File system storage backend
  • 🚧 Puppeteer adapter

Roadmap

See SPEC.md for the complete V0 specification and development roadmap.

Architecture

testfn/
├── src/
│   ├── core/           # Test runner and orchestration
│   ├── storage/        # IndexedDB and storage adapters
│   ├── analytics/      # Metrics and flaky detection
│   ├── reporters/      # Console, JSON, HTML reporters
│   ├── visual/         # Screenshot comparison
│   ├── integrations/   # Framework adapters
│   └── types.ts        # Core type definitions
└── examples/           # Usage examples

Examples

Check the examples/ directory for more usage patterns.

Contributing

Contributions are welcome! Please read the SPEC.md for the project vision and implementation plan.

License

MIT - See LICENSE for details.

Part of Super Functions

TestFn is part of the Super Functions ecosystem - building blocks for software development.