test.js is an extremely lightweight, console API-based unit testing library designed for both Node.js and browser environments. It provides a minimal API for defining test suites and individual tests using simple `[EXPRESSION, EXPECTATION]` arrays. The library aims for simplicity over feature richness, distinguishing itself from more comprehensive testing frameworks. Its latest version, 0.0.4, was released in 2014, indicating that the project is no longer actively maintained. Due to its age, it supports CommonJS modules and global browser scope but lacks modern JavaScript features like ESM, async/await testing, or advanced assertion libraries. Developers seeking a simple, low-overhead solution for basic equality checks in legacy projects might find it useful, but it is not recommended for new projects or environments requiring modern testing paradigms or comprehensive reporting.
npm install test-jsVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define and run basic test suites with test.js in both Node.js and browser environments, including examples of passing and failing assertions.
Migrate to an actively maintained testing framework like Jest, Mocha, Vitest, or QUnit for modern projects.
Consider modern alternatives like Jest, Mocha, or Vitest for projects using ES Modules or asynchronous code.
For more robust testing, integrate a dedicated assertion library or switch to a framework with built-in rich assertions.
Ensure 'test.js' is loaded via a script tag before calling any 'test' methods in the browser. Place your test script after the library script.
In a Node.js CommonJS environment, ensure 'var test = require('test-js');' is at the top of your file. In a browser, use the global 'test' object after loading the script via <script> tag. This library does not support ES Modules.Verify the correct import/script loading method for your environment (CommonJS 'require' for Node.js, <script> tag for browser). Check for conflicting global variables if in a browser environment.
No dependency data recorded yet.