Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

tapjs

> 测试质量
Open source

Test Anything Protocol tools for node

2.4K stars0 likes2 views
WebsiteGitHub

About

Test Anything Protocol tools for node

@tapjs

Workspace for node-tap development.

Dev Commands

Do this at least once to get everything set up and ready to go:

bash
npm run bootstrap

(Note: npm install will not work until you do this, because the generated TypeScript eats its own tail.)


Build the test class (required after any plugin or core changes):

bash
npm run build

Any other builds:

bash
npm run prepare -w src/{whatever}

After adding or removing workspaces:

bash
npm i

Run all tests in all workspaces:

bash
npm test

Run all tests, saving snapshots:

bash
npm run snap

Build and serve docs:

bash
npm start

Contents

  • tap The main entry point module, which sets up the root test runner and exposes an alias to the cli runner.
  • tap-parser The module that parses TAP
  • @tapjs/core Most of the basic moving parts of tap
  • tap-yaml Thin wrapper around YAML and yaml-types for consistent handling of JavaScript values in YAML diagnostics.
  • @tapjs/test The plugin-ified Test class.
  • @tapjs/config Handling config files, command line interface parsing, environment variables, and validation
  • @tapjs/run The command line runner
  • tcompare The library that does comparison and object formatting (use heavily by @tapjs/asserts methods).
  • @tapjs/stack Library for capturing stack frames, the descendant of stack-utils.
  • @tapjs/processinfo The library that tracks process information and code coverage (hosted outside the monorepo, because it can't be tested by a version of tap that uses itself without bootstrap paradoxes)
  • default plugins:
    • @tapjs/typescript Adds typescript support, and the --typecheck config option
    • @tapjs/before Adds t.before()
    • @tapjs/before-each Adds t.beforeEach()
    • @tapjs/after Adds t.after() and t.teardown() (which are the same thing now)
    • @tapjs/after-each Adds t.afterEach()
    • @tapjs/spawn Adds t.spawn()
    • @tapjs/stdin Adds t.stdin()
    • @tapjs/asserts Adds all the various assertion methods, like t.equal(), t.match(), etc.
    • @tapjs/snapshot Adds t.matchSnapshot()
    • @tapjs/fixture Adds t.testdir() features
    • @tapjs/mock Adds t.mockRequire() and t.mockImport()
    • @tapjs/intercept Adds t.intercept() and t.capture() functionality (sort of like a very scaled-down minimal form of Sinon. If you want more, consider using the @tapjs/sinon plugin.)
    • @tapjs/filter Adds t.only() and support for the --grep and --only cli options.
  • optional plugins:
    • @tapjs/nock Optional plugin providing t.nock() method (descendent of @npmjs/tap-nock, and a significant inspiration for tap's plugin architecture)
    • @tapjs/clock Optional plugin providing a clock-mock object on t.clock
    • @tapjs/sinon Optional plugin providing a Sinon sandbox at t.sinon that automatically restores at the end of the test.
    • @tapjs/esbuild-kit Optional plugin that loads TypeScript using @esbuild-kit/cjs-loader and @esbuild-kit/esm-loader instead of ts-node.
  • other stuff:
    • npm-init-template A library for more easily creating npm init packages. This will move out as soon as this version of tap is published.
    • @tapjs/create-plugin An npm init library facilitating npm init @tapjs/plugin to create new plugins.

Bootstrap and skipLibCheck

Run npm run bootstrap to build the @tapjs/test module with the default set of plugins, so that the other libraries can build properly. (This only has to be done once, unless the build script or set of default plugins are changed, of course.)

Because there's a bootstrapping cycle between @tapjs/core, @tapjs/test, and all of the plugins, they MUST use skipLibCheck: true in their tsconfigs. It should not be used in other packages.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptassertbddcode-coveragecommonjs

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category测试质量
PricingOpen source

> Related tools

J
Jest
JavaScript 测试框架
P
Playwright
现代端到端测试框架
E
eslint-plugin-test-selectors
Enforces that data-test-id attributes are added to interactive DOM elements (JSX) to help with UI testing. JSX only.