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

empower

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empower

Power Assert feature enhancer for assert function/object

  • 1.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
142K
decreased by-19.51%
Maintainers
1
Weekly downloads
 
Created

What is empower?

The empower npm package is a tool designed to enhance assertion libraries by providing more detailed and readable assertion error messages. It works by instrumenting assertion functions to capture additional context and information about the assertions being made.

What are empower's main functionalities?

Enhanced Assertion Messages

This feature allows you to use enhanced assertion messages that provide more context and detail about the assertion failure, making it easier to debug.

const assert = require('assert');
const empower = require('empower');
const enhancedAssert = empower(assert);

try {
  enhancedAssert.equal(1, 2);
} catch (e) {
  console.log(e.message); // Outputs detailed assertion error message
}

Integration with Various Assertion Libraries

Empower can be integrated with various assertion libraries, allowing you to enhance the error messages of your existing assertions without changing your testing framework.

const assert = require('assert');
const empower = require('empower');
const enhancedAssert = empower(assert);

try {
  enhancedAssert.deepEqual({ a: 1 }, { a: 2 });
} catch (e) {
  console.log(e.message); // Outputs detailed assertion error message
}

Customizable Output

You can customize the output of the enhanced assertion messages by configuring empower with different patterns and options.

const assert = require('assert');
const empower = require('empower');
const enhancedAssert = empower(assert, { patterns: ['assert.*'] });

try {
  enhancedAssert.equal(1, 2);
} catch (e) {
  console.log(e.message); // Outputs detailed assertion error message
}

Other packages similar to empower

Keywords

FAQs

Package last updated on 08 Sep 2018

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