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

chai-nodules-helpers

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chai-nodules-helpers

nodules-specific assertion helpers for chai

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Nodules-specific assertions for Chai

Installation and usage

$ npm install chai-nodules-helpers
var assert = require('chai').use(require('chai-nodules-helpers')).assert;

assert.throwTerror(...);
assert.mixedProperly(...);

Note

All assertions available for assert style only.

Objex

assert.isMixed()

assert.isMixed(Target, Mixin, mixinName, staticExceptions, prototypeExceptions, mixingArgs)

  • {Objex} Target – constructor;
  • {Function|Object} Mixin – mixin;
  • {String} mixinName – used in assertions messages;
  • {String[]} staticExceptions – array of statics propertyies names excluded from assertions;
  • {String[]} prototypeExceptions – array of prototypes propertyies names excluded from assertions;
  • {Array} [mixingArgs] – additional arguments to pass to mixin() after Mixin itself.

assert.canBeMixed()

assert.canBeMixed(Target, Mixin, mixinName, staticExceptions, prototypeExceptions, mixingArgs)

  • {Objex} Target – constructor, inheritor of the Objex, mixin method applies to;
  • {Function|Object} Mixin – mixin;
  • {String} mixinName – used in assertions messages;
  • {String[]} staticExceptions – array of statics propertyies names excluded from assertions;
  • {String[]} prototypeExceptions – array of prototypes propertyies names excluded from assertions;
  • {Array} [mixingArgs] – additional arguments to pass to mixin() after Mixin itself.

Terror

assert.throwTerror()

assert.throwTerror(fn, ErrorClass, spec)

  • {Function} fn – a function which expected to throw;
  • {Fucntion|Error|Terror} [ErrorClass] – must be a Terror inheritor, if spec is specified, or any Error inheritor in other case;
  • {RegExp|String|Number} [spec] – error specifier; can be a string (Terror code name), number (Terror code) or RegExp (used for message test).

If second argument is not a constructor (function), then helper recognize it as an specifier arg spec.

Keywords

FAQs

Package last updated on 08 Dec 2014

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