talira

node-tap

Test Anything Protocol test framework for JavaScript and TypeScript

open sourceBlueOak-1.0.0free

node-tap is a test framework for JavaScript built on the Test Anything Protocol, with strong TypeScript support. Its API is small (t.test() and assertions, with an optional fancier DSL), and test files are ordinary programs you can run directly. It includes a CLI, many assertion methods, snapshots, spies, module mocking, file system fixtures, lifecycle hooks, test filtering, code coverage and colour-accessible reporters. It's by Isaac Z. Schlueter.

Problems it solves

  • test a Node.js library with built-in coverage
  • TAP-based tests for TypeScript
  • mock modules in Node.js tests

Features

  • TAP output and test files that run as plain programs
  • TypeScript support
  • snapshots, spies and module mocking
  • file system fixtures and lifecycle hooks
  • built-in code coverage
  • CLI with filtering and reporters

Alternatives

The same job

These do what node-tap does.

  1. tape Minimal TAP-producing test harness for Node.js and browsers
  2. Jest Delightful JavaScript Testing
  3. AVA Concise, concurrent test runner for Node.js
  4. Vitest Next generation testing framework powered by Vite

Compare node-tap with the top 3