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

nukta-test-gen

v1.1.1

Published

A CLI tool that auto-generates Jest test cases for Express.js APIs.

Readme

nukta-test-gen

npm version MIT License

🚀 Auto-generate Jest test cases for your Express.js APIs in seconds!


Table of Contents


Features

  • 🔍 Scans your Express.js routes (app.get, router.post, etc.)
  • 📝 Generates Jest test files for each route
  • Status code and response shape checks
  • 🧪 Supports .test.js or .spec.js file extensions
  • 🗂️ Outputs to a tests/ directory (customizable)
  • 🔒 Never executes code—parses only for security
  • Fast, developer-friendly, and extensible

Installation

Global (Recommended)

npm install -g nukta-test-gen

Local (as a dev dependency)

npm install --save-dev nukta-test-gen

Usage

Navigate to your Express.js project root and run:

nukta-test-gen [options]

Or, if installed locally:

npx nukta-test-gen [options]

Options

| Option | Description | Default | | ----------- | ----------------------------------------------- | --------- | | --src, -s | Source directory to scan | src | | --out, -o | Output directory for test files | tests | | --ext, -e | Test file extension (test.js or spec.js) | test.js | | --mock | Include mock data in tests | false | | --dry-run | Show what would be generated, don’t write files | false | | --verbose | Enable verbose logging | false |


How It Works

  1. Scans all .js and .ts files in your source directory (default: src/).
  2. Finds Express route definitions (e.g., app.get('/api', ...), router.post(...)).
  3. Generates Jest test files for each route in your output directory (default: tests/).
  4. Each test checks:
    • Status codes (200, 201, 400, 404)
    • Response shape (object/array)
    • Optionally includes mock data

Example

nukta-test-gen --src api --out tests --ext spec.js --mock --verbose

FAQ

Q: Does it scan all files?

  • It scans all .js and .ts files in the directory you specify, but only generates tests for files with Express route definitions.

Q: Does it execute my code?

  • No. It only parses files for route definitions—never executes or requires them.

Q: Can I use it with TypeScript projects?

  • Yes! It supports both .js and .ts files.

Q: How do I run the generated tests?


Contributing

  1. Fork this repo and clone it.
  2. Install dependencies:
    npm install
  3. Make your changes in src/.
  4. Build the project:
    npm run build
  5. Test your changes.
  6. Submit a pull request!

Publishing

  1. Make sure you are logged in to npm:
    npm adduser
  2. Build the project:
    npm run build
  3. Publish:
    npm publish --access public

License

MIT