@shyftnetwork/shyft_truffle-expect

Simple module for ensuring specific options are passed to a function

Usage no npm install needed!

<script type="module">
  import shyftnetworkShyftTruffleExpect from 'https://cdn.skypack.dev/@shyftnetwork/shyft_truffle-expect';
</script>

README

truffle-expect

Simple module for ensuring expected parameters exist

install

$ npm install truffle-expect

Usage

var expect = require("@shyftnetwork/shyft_truffle-expect");

// The object you're testing
var options = {
  example: "exists"
  another: 5
};

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