Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

better-unit

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

better-unit

Improved nodeunit

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

better-unit

better-unit is a wrapper around the nodeunit module, with the following additions:

  • Support for comparing Map, Set, WeakMap, and WeakSet using the deepEqual() assertion.
  • Simplified, promise-based node API.
  • Automatic detection of rejected promises that have not been handled.

Example

const betterUnit = require('better-unit')

betterUnit.run(['tests'])
  .catch((error) => {
    console.error(error.stack)
    process.exitCode = 1
  })

Command Line

better-unit includes a command line program to run tests as well.

better-unit testmodule1.js testfolder [...]

Command Line Options

better-unit supports a subset of nodeunit's command line options:

  • -r: Recurse into subdirectories.
  • -t testName: Filter tests based on testName.

API

betterUnit.run(files, options) Returns: Promise

Runs all specified tests.

  • files (Array): A list of files or directories containing tests to run.
  • options (Object): Configuration for the nodeunit reporter.
    • recursive (Boolean): Whether nodeunit should recurse into subdirectories of files to find tests.
    • testspec (String): Filter tests based on the specified test name.
    • rejectionDelay (Number): Duration in milliseconds to wait for unhandled rejections to be handled before terminating the test run due to an unhandled rejection.

License

Copyright better-unit contributors. Released under the terms of the ISC license.

FAQs

Package last updated on 19 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc