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

@dashkite/assert

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dashkite/assert

Lightweight browser-friendly Javascript assertions.

  • 0.1.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-25%
Maintainers
2
Weekly downloads
 
Created
Source

Assert

Lightweight browser-friendly Javascript assertions.

assert isDefined foo
assert.equal foo, bar
assert.deepEqual foo, bar
assert.throws -> throw "oh no"
assert.rejects -> Promise.reject "oh no"

Features

  • ESM friendly
  • Lightweight (1.3kB in the browser)
  • Curryable
  • Plain assert takes only true — no “truth” values

Install

npm i @dashkite/assert

Reference

assert

assert condition → boolean

Returns true if condition is true, throws otherwise.

assert.equal

assert.equal expected, actual → boolean

Returns true if expected is strictly equal to actual, throws otherwise.

assert.notEqual

assert.notEqual expected, actual → boolean

Returns true if expected is strictly not equal to actual, throws otherwise.

assert.deepEqual

assert.deepEqual expected, actual → boolean

Returns true if expected is deep equal to actual, throws otherwise.

assert.notDeepEqual

assert.notDeepEqual expected, actual → boolean

Returns true if expected is not deep equal to actual, throws otherwise.

assert.throws

assert.throws function → boolean

Returns true if function throws, throws otherwise.

assert.doesNotThrow

assert.throws function → boolean

Returns true if function does not throw, throws otherwise.

assert.rejects

assert.rejects function → boolean

Returns true if function returns a promise that rejects, throws otherwise.

assert.doesNotReject

assert.rejects function → boolean

Returns true if function returns a promise that does not reject, throws otherwise.

Keywords

FAQs

Package last updated on 13 Nov 2021

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