# @goplugin/plugin-test-helpers

> Helpers for testing plugin contracts

Latest version **1.0.0** (published 2021-09-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @goplugin/plugin-test-helpers
pnpm add @goplugin/plugin-test-helpers
yarn add @goplugin/plugin-test-helpers
bun add @goplugin/plugin-test-helpers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-09-29 |
| First published | 2021-09-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | goplugin |
| Maintainers | goplugin |
| Keywords | plugin, helpers |

## Links

- npm: https://www.npmjs.com/package/@goplugin/plugin-test-helpers
- npm.io page: https://npm.io/package/@goplugin/plugin-test-helpers

## Dependencies (3)

- [bn.js](https://npm.io/package/bn.js.md) ^4.11.8
- [ethereumjs-abi](https://npm.io/package/ethereumjs-abi.md) ^0.6.6
- [ethereumjs-util](https://npm.io/package/ethereumjs-util.md) ^6.0.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2021-09-29

## README

## Usage

Add to your project

```shell
npm install @goplugin/plugin-test-helpers --save
```

Add to tests

```javascript
const h = require("@goplugin/plugin-test-helpers");
```

### Helper Methods

Below are some examples of how to use the helper methods.

#### assertActionThrows

```javascript
await h.assertActionThrows(async () => {
  await cc.createRequest(jobId, url, path, times, {from: consumer});
});
```

#### decodeRunRequest

```javascript
let tx = await cc.createRequest(jobId, url, path, times, {from: consumer});
request = h.decodeRunRequest(tx.receipt.rawLogs[3]);
```

#### fulfillOracleRequest

```javascript
let tx = await cc.createRequest(jobId, url, path, times, {from: consumer});
request = h.decodeRunRequest(tx.receipt.rawLogs[3]);
await h.fulfillOracleRequest(oc, request, response, {from: oracleNode});
```

#### increaseBlocks

```javascript
h.increaseBlocks(25)
```

#### increaseTime5Minutes

```javascript
h.increaseTime5Minutes();
```

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