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

@thispeoplestudio/peopletester

v1.0.1

Published

Simple and powerful test framework with 50+ matchers, async support, and beautiful CLI output

Readme

README — PeopleTester

🧪 PeopleTester

Simple, powerful, and beautiful test framework for Node.js

GitHub npm MIT License


✨ Features

  • 50+ MatcherstoBe, toEqual, toThrow, toContain, and more
  • HooksbeforeEach and afterEach for clean test setup
  • Async Support — Full support for Promises and async/await
  • Skip Tests — Skip specific tests with .skip flag
  • Beautiful Output — Colorful CLI reports with chalk
  • JSON Reports — Export test results to JSON files
  • Self-Testing — 100% test coverage with self-tests
  • TypeScript — Full type definitions included

📦 Installation

npm install @thispeoplestudio/peopletester

🚀 Quick Start

import PeopleTester from '@thispeoplestudio/peopletester';

const tester = new PeopleTester();

tester.describe('Math Operations', 'Testing basic arithmetic', () => {
    tester.it('addition', '2 + 2 should equal 4', () => {
        tester.expect(2 + 2).toBe(4);
    });

    tester.it('multiplication', '3 * 3 should equal 9', () => {
        tester.expect(3 * 3).toBe(9);
    });
});

await tester.run();
await tester.saveToFile('test-report.json');

📊 Matchers Reference

Basic Matchers

Matcher

Description

toBe(expected)

Strict equality (===)

toEqual(expected)

Deep equality for objects/arrays

toStrictEqual(expected)

Deep equality with type checking

Numeric Matchers

Matcher

Description

toBeGreaterThan(expected)

actual > expected

toBeGreaterThanOrEqual(expected)

actual >= expected

toBeLessThan(expected)

actual < expected

toBeLessThanOrEqual(expected)

actual <= expected

toBeCloseTo(expected, precision?)

Floating point comparison

toBeFinite()

Check if number is finite

toBeInteger()

Check if number is integer

toBeNaN()

Check if value is NaN

toBePositive()

Check if number is positive

toBeNegative()

Check if number is negative

Logical Matchers

Matcher

Description

toBeTruthy()

Check if value is truthy

toBeFalsy()

Check if value is falsy

toBeDefined()

Check if value is not undefined

toBeUndefined()

Check if value is undefined

toBeNull()

Check if value is null

Object Matchers

Matcher

Description

toBeInstanceOf(expected)

Check if value is instance of class

toHaveProperty(property, value?)

Check if object has property

toMatchObject(expected)

Check if object matches partial structure

Array Matchers

Matcher

Description

toContain(expected)

Check if array contains value

toContainEqual(expected)

Check if array contains equal object

toHaveLength(expected)

Check array length

toBeEmpty()

Check if array/object/string is empty

String Matchers

Matcher

Description

toMatch(pattern)

Check if string matches regex or substring

toContainString(expected)

Check if string contains substring

toStartWith(expected)

Check if string starts with prefix

toEndWith(expected)

Check if string ends with suffix

Function Matchers

Matcher

Description

toThrow(expected?)

Check if function throws error

toThrowError(expected?)

Alias for toThrow

toHaveReturned()

Check if function returned

toHaveReturnedWith(expected)

Check if function returned specific value

Promise Matchers

Matcher

Description

toResolve()

Check if Promise resolves

toReject()

Check if Promise rejects

toRejectWith(expected)

Check if Promise rejects with specific error

Negation

Matcher

Description

.not

Inverts any matcher: expect(2).not.toBe(3)


📚 API Reference

describe(name, description, callback)

Groups tests together.

tester.describe('User Service', 'Tests for user service', () => {
    // tests here
});

it(name, description, callback)

Defines a test case.

tester.it('getUser', 'Should return user by ID', () => {
    tester.expect(getUser(1)).toEqual({ id: 1, name: 'John' });
});

beforeEach(callback)

Runs before each test in the current describe block.

tester.beforeEach(() => {
    database.clear();
});

afterEach(callback)

Runs after each test in the current describe block.

tester.afterEach(() => {
    cleanup();
});

expect(actual)

Creates a matcher object.

tester.expect(2 + 2).toBe(4);

run()

Executes all registered tests.

const results = await tester.run();

saveToFile(filename)

Saves test results as JSON file.

await tester.saveToFile('test-report.json');

📝 Usage Examples

Basic Tests

tester.describe('Basic Math', 'Tests for basic math operations', () => {
    tester.it('should add numbers correctly', '2 + 2 should equal 4', () => {
        tester.expect(2 + 2).toBe(4);
    });

    tester.it('should multiply numbers correctly', '3 * 3 should equal 9', () => {
        tester.expect(3 * 3).toBe(9);
    });
});

Object Tests

tester.describe('Objects', 'Testing object comparisons', () => {
    const user = { id: 1, name: 'John', age: 30 };

    tester.it('should match object structure', 'User should have correct properties', () => {
        tester.expect(user).toMatchObject({ name: 'John', age: 30 });
        tester.expect(user).toHaveProperty('id', 1);
    });

    tester.it('should deep equal', 'Users should be equal', () => {
        tester.expect({ id: 1, name: 'John' }).toEqual({ id: 1, name: 'John' });
    });
});

Async Tests

tester.describe('Async', 'Testing asynchronous code', () => {
    tester.it('should handle promises', 'Promise should resolve', async () => {
        const result = await fetchData();
        tester.expect(result).toBe('data');
    });

    tester.it('should handle errors', 'Promise should reject', async () => {
        await tester.expect(fetchError()).toRejectWith('Network error');
    });
});

Using Hooks

let counter = 0;

tester.describe('With Hooks', 'Testing beforeEach and afterEach', () => {
    tester.beforeEach(() => {
        counter = 0;
    });

    tester.afterEach(() => {
        tester.expect(counter).toBe(1);
    });

    tester.it('should increment counter', 'Counter should be 1', () => {
        tester.expect(counter).toBe(0);
        counter++;
        tester.expect(counter).toBe(1);
    });
});

📄 License

MIT — feel free to use, modify, and distribute.


Made with ❤️ by This People Studio