This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@truffle/expect
TypeScript icon, indicating that this package has built-in type declarations

0.1.7 • Public • Published

@truffle/expect

Simple module for ensuring expected parameters exist

install

$ npm install @truffle/expect

Usage

const expect = require("@truffle/expect");

// the object you're testing
const options = {
  example: "exists",
  another: 5
};

expect.options(options, ["example", "another"]); // does nothing because both key values exist
expect.options(options, ["example", "another", "some_other_key"]); // errors because options["some_other_key"] is undefined

expect.one(options, ["example", "optional_key"]); // does nothing because at least one key value exists
expect.one(options, ["optional_key", "other_optional_key"]); // errors because both key values are undefined

Readme

Keywords

Package Sidebar

Install

npm i @truffle/expect

Weekly Downloads

3,298

Version

0.1.7

License

MIT

Unpacked Size

6.65 kB

Total Files

6

Last publish

Collaborators

  • rizedr
  • kevinbluer
  • fainashalts
  • cds-amal