truffle-conflux-expect

0.0.2-alpha.0 • Public • Published

truffle-conflux-expect

Simple module for ensuring expected parameters exist

install

$ npm install truffle-conflux-expect

Usage

const expect = require("truffle-conflux-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-conflux-expect

Weekly Downloads

1

Version

0.0.2-alpha.0

License

MIT

Unpacked Size

3.8 kB

Total Files

5

Last publish

Collaborators

  • liuis