{"library":"node-test-reporter","title":"Node.js Built-in Test Reporter","description":"node-test-reporter is an opinionated, actively maintained test reporter for Node.js's built-in test runner, providing a clean, Ava-inspired output experience. Its current stable version is 1.2.0, with minor releases frequently addressing bugs and adding small features. It differentiates itself by offering enhanced error formatting for `equal` and `strictEqual` assertions via `concordance`, improved stack trace reporting, and an early error display mechanism for tests that hang due to unclosed resources. The reporter also integrates with Node.js's experimental code coverage features and provides a distinct visual style, including flipped plus/minus signs for diffs compared to the default Node.js reporter. It is designed for Node.js environments version 18 and newer, with specific recommendations for v22+ for optimal coverage reporting.","language":"javascript","status":"active","last_verified":"Sun Apr 19","install":{"commands":["npm install node-test-reporter"],"cli":null},"imports":["node --test --test-reporter node-test-reporter 'src/**/*.test.js'","node --import tsx --test --enable-source-maps --test-reporter node-test-reporter 'src/**/*.test.ts'","\"test\": \"node --test --test-reporter node-test-reporter 'src/**/*.test.js'\""],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import assert from 'node:assert';\nimport { test } from 'node:test';\n\ntest('My passing test example', () => {\n  assert.strictEqual(1, 1, 'Expected 1 to be 1');\n});\n\ntest('My failing test to demonstrate diff and error reporting', () => {\n  const actual = { id: 1, data: { name: 'Alice', age: 30 } };\n  const expected = { id: 1, data: { name: 'Alice', age: 31 } };\n  assert.deepStrictEqual(actual, expected, 'Expected objects to be deeply equal but age differs');\n});\n\ntest('Another passing asynchronous test', async (t) => {\n  await new Promise(resolve => setTimeout(resolve, 100)); // Simulate async work\n  assert.ok(true, 'Asynchronous operation successfully completed');\n});\n\n// To run this after `npm install node-test-reporter -D`:\n// 1. Save this content as `my.test.js`.\n// 2. Execute in your terminal: `node --test --test-reporter node-test-reporter my.test.js`","lang":"javascript","description":"This quickstart provides runnable JavaScript test code to demonstrate passing and failing assertions, including a deep equality diff, and how to execute it with the `node-test-reporter`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}