{"id":15012,"library":"urun","title":"urun: Minimal Test Runner","description":"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.","status":"abandoned","version":"0.0.8","language":"javascript","source_language":"en","source_url":"https://github.com/felixge/node-urun","tags":["javascript"],"install":[{"cmd":"npm install urun","lang":"bash","label":"npm"},{"cmd":"yarn add urun","lang":"bash","label":"yarn"},{"cmd":"pnpm add urun","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"urun is a CommonJS module and exports a single function. Direct ES module `import` syntax will result in a runtime error.","wrong":"import urun from 'urun';","symbol":"default export (function)","correct":"const urun = require('urun');\nurun(__dirname);"},{"note":"The package's main export is the function itself, so it's directly invokable after `require`. There are no named exports like `run`.","wrong":"require('urun').run(__dirname);","symbol":"direct execution","correct":"require('urun')(__dirname);"},{"note":"Configuration is passed as an options object directly to the function call.","symbol":"with options","correct":"require('urun')(__dirname, { verbose: true, include: /.+Test\\.js$/ });"}],"quickstart":{"code":"const urun = require('urun');\nconst path = require('path');\n\n// Create a dummy test file\nrequire('fs').writeFileSync(path.join(__dirname, 'test-example.js'), `\n  const assert = require('assert');\n  module.exports = {\n    'should pass a basic assertion': function() {\n      assert.strictEqual(1, 1, '1 should equal 1');\n    },\n    'should fail a basic assertion': function() {\n      assert.strictEqual(1, 2, '1 should equal 2');\n    }\n  };\n`);\n\n// Run tests in the current directory with verbose output\nconsole.log('Running tests with urun...');\nprocess.on('exit', (code) => {\n  if (code === 0) {\n    console.log('All tests passed.');\n  } else {\n    console.log('Some tests failed. Exit code:', code);\n  }\n  // Clean up dummy test file\n  require('fs').unlinkSync(path.join(__dirname, 'test-example.js'));\n});\n\nurun(__dirname, { verbose: true });","lang":"javascript","description":"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)."},"warnings":[{"fix":"Consider using actively maintained test runners like Jest, Mocha, or Vitest for new projects or migrating existing projects from urun.","message":"The `urun` package has not been updated in over a decade. The latest commit on GitHub is 13 years old, and the `package.json` was last updated 12 years ago. This means it is no longer actively maintained and may have compatibility issues with modern Node.js versions or lack security updates.","severity":"gotcha","affected_versions":">=0.0.8"},{"fix":"Always use `const urun = require('urun');` to import this package. If your project is pure ESM, you may need to wrap `urun` in a CommonJS context or consider a different test runner.","message":"Given its age, `urun` is strictly a CommonJS module. Attempting to import it using ES module `import` syntax (`import urun from 'urun';`) in a modern Node.js environment configured for ESM will result in a `SyntaxError`.","severity":"breaking","affected_versions":">=0.0.1"},{"fix":"Evaluate your testing needs. For simple, synchronous tests, urun might suffice. For complex applications, features like mocking or component testing, or improved developer experience, a more comprehensive test runner is recommended.","message":"The package is extremely minimal and lacks features common in modern test runners, such as built-in watch mode, parallel test execution, mocking utilities, advanced assertion libraries (it relies on Node's built-in `assert`), or rich reporting beyond basic console and TAP output.","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Use CommonJS `require` syntax: `const urun = require('urun');`","cause":"Attempting to use ES module `import` syntax (`import urun from 'urun';`) for the `urun` package in an environment where it's treated as a CommonJS module.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Import the module as a single function: `const urun = require('urun');`","cause":"Attempting to destructure `urun` as a named export, e.g., `const { urun } = require('urun');`, when the package's main export is the function itself (a 'default' CommonJS export).","error":"TypeError: require(...) is not a function"},{"fix":"Ensure test files follow the `test-*.js` naming convention or adjust the `include` option: `urun(__dirname, { include: /.+Test\\.js$/ });` Also, verify `__dirname` or the path passed to `urun` points to the correct directory containing your tests.","cause":"The default test file pattern `/test-.+\\.js$/` or a custom `include` regex does not match any files in the specified directory, or `__dirname` points to an incorrect location.","error":"No tests found matching pattern"}],"ecosystem":"npm"}