Trapit - JavaScript Unit Tester/Formatter

JSON →
library 1.0.24 ·javascript maintenance
verified Jun 4, 2026

Trapit (v1.0.24) is a JavaScript module implementing The Math Function Unit Testing Design Pattern. It provides a data-driven approach to unit testing where test inputs and expected outputs are specified in JSON, leading to reusable scenarios. Key features include: multi-scenario testing, formatted output as plain text or HTML, support for external programs via JSON results file, and avoidance of microtesting. It is designed for transactional units and supports refactoring. The module has a stable release cadence (last update years ago) and differs from traditional frameworks like Jest or Mocha by emphasizing declarative test data and full scenario coverage according to the SCAN method.