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

@pfacheris/implementation-utils-test-utils

v0.0.3

Published

Provides utilities for testing Flatfile Implementations

Readme

@flatfile/implementations-utils-test-utils

Provides utilities for testing Flatfile Implementations, especially for listeners and job workers. This package is designed to work with testing frameworks like Jest.

Features

  • bootstrapWorkbook / bootstrapSheet: Automatically create and tear down Spaces and Workbooks for your tests using beforeAll/afterAll or beforeEach/afterEach.
  • Scenario: Load test data from markdown files, define input and expected output, and assert that your code produces the correct results.
  • Test Helpers: Utility functions like requireJobToComplete to wait for asynchronous operations to finish in your tests.

Usage

Bootstrapping a Test Environment

Use bootstrapSheet to create a temporary workbook with a single sheet for your test. It will be automatically deleted after the test runs.

import { bootstrapSheet } from "@flatfile/implementations-utils-test-utils";
import { Flatfile } from "@flatfile/api";

describe("My Test Suite", () => {
  // This will create a new space and workbook before all tests in this suite
  // and delete the space after all tests are done.
  const { sheet, space } = bootstrapSheet(
    {
      name: "Contacts",
      slug: "contacts",
      fields: {
        firstName: { type: "string", label: "First Name" },
        lastName: { type: "string", label: "Last Name" },
        email: { type: "string", label: "Email" },
      },
    },
    "once" // or "each"
  );

  it("should do something with the sheet", () => {
    // You can now use `sheet()` and `space()` to access the created resources.
    // Note: these are functions that return the bootstrapped resources.
    expect(sheet().slug).toBe("contacts");
    expect(space().id).toBeDefined();
  });
});

Using Scenarios for Data-Driven Tests

The Scenario class lets you define test cases in simple markdown files.

my-test.scenario.md:

# Test Case: Basic User Data

## Input

### `contacts`

| firstName | lastName | email                |
| --------- | -------- | -------------------- |
| John      | Doe      | [email protected] |
| Jane      | Doe      | [email protected] |

## Output

### `users`

| fullName | emailAddress         |
| -------- | -------------------- |
| John Doe | [email protected] |
| Jane Doe | [email protected] |

Your test file:

import { Scenario } from "@flatfile/implementations-utils-test-utils";
import { Collection, FlatfileRecord } from "@flatfile/safe-api";

it("should transform contacts to users", () => {
  // Load the scenario
  const scenario = new Scenario("path/to/my-test.scenario.md");

  // Get the input data as a collection of records
  const inputData = scenario.getInput();

  // Your transformation logic here...
  const outputData = yourTransformationFunction(inputData); // This should return a Collection

  // Assert that the output matches the expectation in the scenario file
  scenario.assertDataMatchesOutputExpectation(outputData, ["users"]);
});

This approach makes it easy to manage complex test data and keep your tests clean and readable.