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

@buddy-works/unit-tests

v0.21.2

Published

Universal test results collector for Jest, Jasmine, Mocha, Cypress, Playwright, and Vitest that sends results to Buddy Works API in real-time

Readme

@buddy-works/unit-tests

NPM Version

Universal test results collector that sends real-time test results from popular JavaScript testing frameworks directly to your Buddy Works unit testing dashboard. Zero configuration required - just install, add to your test config, and go.

Supported frameworks: Jest, Jasmine, Mocha, Cypress, Playwright, Vitest

Installation

npm install --save-dev @buddy-works/unit-tests

Setup

1. Get your token

In your Buddy Works workspace, go to the Unit Tests section and create a new suite. You'll receive a BUDDY_UT_TOKEN - set this as an environment variable in your CI/CD pipeline.

2. Add to your test configuration

Choose your testing framework and add the reporter:

Jest (jest.config.js):

module.exports = {
  reporters: ['default', '@buddy-works/unit-tests/jest'],
}

Or run from CLI:

jest --reporters=default --reporters=@buddy-works/unit-tests/jest

Jasmine:

Run from CLI:

jasmine --reporter=@buddy-works/unit-tests/jasmine

Mocha (.mocharc.js):

module.exports = {
  reporter: '@buddy-works/unit-tests/mocha',
}

Or run from CLI:

mocha --reporter=@buddy-works/unit-tests/mocha

Vitest (vitest.config.js):

import { defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    reporters: ['default', '@buddy-works/unit-tests/vitest'],
  },
})

Or run from CLI:

vitest --reporter=default --reporter=@buddy-works/unit-tests/vitest

Playwright (playwright.config.js):

import { defineConfig } from '@playwright/test'

export default defineConfig({
  reporter: [['@buddy-works/unit-tests/playwright']],
})

Or run from CLI:

npx playwright test --reporter=@buddy-works/unit-tests/playwright

Cypress (cypress.config.js):

const { defineConfig } = require('cypress')
const BuddyCypressReporter = require('@buddy-works/unit-tests/cypress')

module.exports = defineConfig({
  e2e: {
    reporter: '@buddy-works/unit-tests/dist/reporters/cypress/index.js',
    setupNodeEvents(on) {
      on('after:run', BuddyCypressReporter.closeSession)
    },
  },
})

Or run from CLI (still requires the after:run hook in config):

cypress run --reporter @buddy-works/unit-tests/dist/reporters/cypress/index.js

Note for Cypress:

  • You must install mocha as a dev dependency: npm install --save-dev mocha
  • The after:run event handler must be configured in the config file even when using CLI
  • The reporter path must use the dist path format due to Cypress's module resolution

That's it! Your tests will now automatically send results to Buddy Works.

Note: These examples show configuration file setups. Some frameworks may support alternative configuration methods (command line options, package.json, etc.). Refer to your testing framework's official documentation for all available configuration options.

How It Works

The collector automatically detects your CI/CD environment and gathers all necessary metadata from your pipeline. It creates test sessions, tracks individual test results in real-time, and handles session cleanup automatically.

Supported CI/CD platforms:

  • Buddy Works - Full native support with automatic environment detection
  • GitHub Actions - Complete support with workflow integration
  • Other platforms - Can be configured manually with environment variables

Designed for CI/CD: While it can run locally, it's optimized for CI/CD pipelines where environment variables are automatically available.

Key Features

  • Zero configuration - Only requires BUDDY_UT_TOKEN
  • Real-time reporting - Test results sent as they complete
  • Automatic session management - Handles test session lifecycle
  • Universal support - Works with all major JavaScript testing frameworks
  • Multi-platform CI/CD support - Native support for Buddy Works and GitHub Actions
  • Smart environment detection - Automatically detects CI environment and configures accordingly

Development Testing

To run the example tests for development and testing purposes:

  1. Install dependencies:

    npm i
  2. Prepare the package for testing:

    npm run prepare:tests
  3. Follow individual test instructions: Each test framework has its own directory under examples/ with specific setup instructions. Check the README file in each individual test directory for framework-specific instructions.

    Available test frameworks:

    • examples/jest/ - Jest testing framework
    • examples/jasmine/ - Jasmine testing framework
    • examples/mocha/ - Mocha testing framework
    • examples/cypress/ - Cypress testing framework
    • examples/playwright/ - Playwright testing framework
    • examples/vitest/ - Vitest testing framework