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

buster-more-assertions

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

buster-more-assertions

Additional assertions for buster.js

  • 0.1.1-2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

buster-more-assertions

Additional assertions for buster.js.

Matchers

At the moment, only matchers for arrays and array-like objects are provided.

Array / Sequence Matchers

Contains by Identity (===)

Similar to assert.contains, the following assertions are provided:

  • assert.containsOnce(array, element) passes if array contains element exactly once.

  • assert.containsInOrder(array, a, b, c, ...) passes if array contains all passed-in values in that order.

Contains by Match

The following assertions check for matching elements. See the documentation of assert.match to understand how buster matches.

  • assert.containsMatch(array, matcher) passes if any element in array matches matcher.

  • assert.containsMatchOnce(array, matcher) passes if exactly one element in array matches matcher.

  • assert.containsMatchesInOrder(array, matcherA, matcherB, ...) passes if elements matching the passed-in matchers are contained in the given order.

Contains by Equality

These assertions check sequence elements by equality. Read the documentation of assert.equals to understand how buster checks for equality.

  • assert.containsEqual(array, value) passes if any element in array equals value.

  • assert.containsEqualOnce(array, value) passes if exactly one element in array equals value.

  • assert.containsEqualsInOrder(array, valueA, valueB, ...) passes if elements equaling the passed-in values are contained in the given order.

Contribute

Contributions welcome! Please make sure that your assertion functions are properly tested. Don’t test assert.myAssert(), but only the assertion function.

Keywords

FAQs

Package last updated on 04 Jun 2013

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