urun: Minimal Test Runner

0.0.8 · abandoned · verified Sun Apr 19

urun is a minimal, file-based test runner for Node.js environments. Currently at version 0.0.8, its development appears to be abandoned, with the last significant update to its `package.json` occurring 12 years ago and the last commit 13 years ago. It was designed for simplicity, running `test-*.js` files by default within a specified directory, providing a progress indication, and showing detailed output only for failing tests unless `verbose` mode is enabled. Its key differentiators include its extremely lightweight footprint and direct CommonJS `require` based usage, eschewing complex configuration or modern CLI tools. It offers basic reporter options like 'BashReporter' and 'BashTapReporter' for TAP-compliant output.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to initialize urun to discover and run `test-*.js` files in the current directory, enabling verbose output for all tests (passing and failing).

const urun = require('urun');
const path = require('path');

// Create a dummy test file
require('fs').writeFileSync(path.join(__dirname, 'test-example.js'), `
  const assert = require('assert');
  module.exports = {
    'should pass a basic assertion': function() {
      assert.strictEqual(1, 1, '1 should equal 1');
    },
    'should fail a basic assertion': function() {
      assert.strictEqual(1, 2, '1 should equal 2');
    }
  };
`);

// Run tests in the current directory with verbose output
console.log('Running tests with urun...');
process.on('exit', (code) => {
  if (code === 0) {
    console.log('All tests passed.');
  } else {
    console.log('Some tests failed. Exit code:', code);
  }
  // Clean up dummy test file
  require('fs').unlinkSync(path.join(__dirname, 'test-example.js'));
});

urun(__dirname, { verbose: true });

view raw JSON →