# @truffle/expect

> Simple module for ensuring specific options are passed to a function

Latest version **0.1.7** (published 2023-09-07) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @truffle/expect
pnpm add @truffle/expect
yarn add @truffle/expect
bun add @truffle/expect
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.7 |
| Published | 2023-09-07 |
| First published | 2019-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^16.20 \|\| ^18.16 \|\| >=20 |
| Dependencies | 0 |
| Unpacked size | 6.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13909 |
| Author | Tim Coulter |
| Maintainers | rizedr, joshuafernandes, cliffoo, kevinbluer, gnidan, haltman, eggplantzzz, fainashalts, cds-amal |
| Keywords | ethereum, expect, truffle |

## Links

- npm: https://www.npmjs.com/package/@truffle/expect
- Repository: https://github.com/trufflesuite/truffle
- Homepage: https://github.com/trufflesuite/truffle/blob/master/packages/expect#readme
- Issues: https://github.com/trufflesuite/truffle/issues
- npm.io page: https://npm.io/package/@truffle/expect

## Recent versions

- 0.1.7 (latest) — 2023-09-07
- 0.1.2-typescript-migrations.0 (typescript-migrations) — 2022-07-21
- 0.0.14-next.0 (next) — 2020-07-09
- 0.1.0-tezos.0 (tezos) — 2020-02-18
- 0.0.14-alphaTez.9 (alphaTez) — 2020-02-13
- 0.1.0-ens-events.0 (ens-events) — 2019-09-27
- 0.1.6 — 2023-06-06
- 0.1.5 — 2023-02-17
- 0.1.4 — 2022-11-23
- 0.1.3 — 2022-08-17
- 0.1.2 — 2022-07-21
- 0.1.1 — 2022-04-08
- 0.1.0 — 2022-02-11
- 0.0.19 — 2022-01-29
- 0.0.18 — 2021-08-12
- … 29 more at https://npm.io/package/@truffle/expect/versions

## README

# @truffle/expect
Simple module for ensuring expected parameters exist

### install

```
$ npm install @truffle/expect
```

### Usage

```javascript
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
```

---
_Source: https://npm.io/package/@truffle/expect · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
