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

@scaffit/jest

v1.0.5

Published

Jest unit testing setup with framework-specific configurations for Next.js, React, Vue, Angular, Svelte, Express, Fastify, Node.js projects

Readme

@scaffit/jest

Jest unit testing setup with framework-specific configurations for Next.js, React, Vue, Angular, Svelte, Express, Fastify, Node.js projects.

Features

  • Framework Detection: Automatically detects your project framework and configures Jest accordingly
  • TypeScript Support: Full TypeScript support with ts-jest
  • Coverage Reporting: Built-in coverage reporting with HTML and LCOV formats
  • Test Setup: Framework-specific test setup files
  • Mock Utilities: Pre-configured mock utilities for common scenarios
  • Custom Matchers: Optional custom Jest matchers
  • ESLint Integration: Works seamlessly with ESLint

Supported Frameworks

  • Next.js
  • React (Vite, Create React App)
  • Vue
  • Angular
  • Svelte
  • Express
  • Fastify
  • Node.js

Installation

Option 1: Using Scaffit CLI (Recommended)

# Add Jest scaffold (no installation needed!)
npx scaffit add jest

Alternative: Global Installation

# Install CLI globally
npm install -g scaffit

# Add Jest scaffold
scaffit add jest

Option 2: Direct npm package usage

# Install scaffold directly
npm install @scaffit/jest

# Use in your code
import { setupJest, previewJest } from '@scaffit/jest';

// Setup Jest with custom options
const result = await setupJest({
  includeCoverage: true,
  includeSetupFiles: true,
  features: ['typescript', 'eslint', 'mocks', 'utils'],
  projectRoot: './my-project'
});

// Preview changes before applying
const preview = await previewJest({
  includeCoverage: true,
  features: ['typescript', 'eslint']
});

Note: Both approaches require @scaffit/core to be installed (automatically handled).

Usage

After installation, you can immediately run tests:

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Note: Testing is ready to use immediately after installation.

Configuration Options

  • Include Coverage: Enable coverage reporting
  • Include Setup Files: Create framework-specific test setup files
  • TypeScript Support: Add TypeScript support with ts-jest
  • ESLint Integration: Integrate with ESLint
  • Mock Utilities: Include mock utilities
  • Custom Matchers: Add custom Jest matchers
  • Test Utilities: Include test utility functions

Generated Files

  • jest.config.js - Jest configuration file
  • test/setup.ts - Test setup file (if enabled)
  • test/example.test.ts - Example test file
  • test/utils.ts - Test utilities (if enabled)
  • test/mocks.ts - Mock utilities (if enabled)

Scripts Added

  • test - Run tests
  • test:watch - Run tests in watch mode
  • test:coverage - Run tests with coverage

Framework-Specific Features

Next.js

  • jsdom environment
  • Next.js router mocking
  • Image component mocking
  • Testing Library integration

React

  • jsdom environment
  • Testing Library integration
  • User event testing
  • Component testing utilities

Vue

  • jsdom environment
  • Vue Test Utils integration
  • Component testing utilities
  • Global test configuration

Angular

  • jsdom environment
  • Angular Testing integration
  • TestBed configuration
  • Component testing utilities

Svelte

  • jsdom environment
  • Svelte Testing Library integration
  • Store mocking
  • Component testing utilities

Express/Fastify/Node.js

  • Node environment
  • Request/Response mocking
  • API testing utilities
  • Server testing helpers

License

MIT