Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 2.33 KB

File metadata and controls

62 lines (43 loc) · 2.33 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

CRITICAL: Do Not Release

NEVER release, publish, or attempt to release this package. Do not:

  • Run npm publish or release-it
  • Modify version numbers in package.json for release purposes
  • Amend or modify release commits
  • Create release tags
  • Hand-edit CHANGELOG.md — it is generated entirely by release-it (lerna-changelog) from merged PR titles. Never add headings, sections, or entries to it, not even an "Unreleased" section.

The maintainer handles all releases manually.

Project Overview

bintastic is a test harness for Node.js CLI tools. It creates temporary directories with fixture files, spawns CLI binaries as subprocesses, and captures their output for assertion.

Commands

npm test              # Run lint + tests
npm run test:vitest   # Run tests only
npm run lint          # ESLint + Prettier check + markdown-code check
npm run build         # Build CJS and ESM with tsup
npm run docs:dev      # Generate API reference + run the VitePress dev server
npm run docs:build    # Generate API reference + build the docs site
npm run format        # Format all files with Prettier

Run a single test:

npx vitest run -t "test name pattern"

Architecture

The library exports two main pieces:

  1. createBintastic(options) - Factory function that returns test helpers:

    • setupProject() - Creates a temp directory with a BintasticProject
    • teardownProject() - Cleans up the temp directory
    • runBin(...args) - Executes the configured CLI binary via execaNode
    • runBinDebug(...args) - Same as runBin but with Node inspector enabled
  2. BintasticProject - Extends fixturify-project's Project class. Provides:

    • files property for defining fixture files
    • write() to persist files to the temp directory
    • gitInit() to initialize a git repo
    • chdir() / dispose() for directory management

Key Dependencies

  • execa v9 - Subprocess execution. Uses execaNode for running Node scripts with nodeOptions for inspector flags.
  • fixturify-project - Temp directory and fixture file management.

Debugging Tests

Set BINTASTIC_DEBUG=attach or BINTASTIC_DEBUG=break to enable Node inspector and preserve fixture directories after test runs.