# epic-tester

> easy Epic test

Latest version **0.2.0** (published 2018-03-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install epic-tester
pnpm add epic-tester
yarn add epic-tester
bun add epic-tester
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2018-03-31 |
| First published | 2018-03-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6 |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | akameco |
| Maintainers | akameco |
| Keywords | redux, redux-observable, rx, rxjs, epic, tester, epic-tester, observable, jest, test |

## Links

- npm: https://www.npmjs.com/package/epic-tester
- Repository: https://github.com/akameco/epic-tester
- npm.io page: https://npm.io/package/epic-tester

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2018-03-31
- 0.1.0 — 2018-03-12

## README

# epic-tester

[![Build Status](https://travis-ci.org/akameco/epic-tester.svg?branch=master)](https://travis-ci.org/akameco/epic-tester)
[![tested with jest](https://img.shields.io/badge/tested_with-jest-99424f.svg)](https://github.com/facebook/jest)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors)

> simple Epic Marble Test

## Install

```
$ yarn add --dev epic-tester
```

## Usage

```js
const { epicTester } = require('epic-tester')

epicTester({
  title: 'Success API',
  epic,
  dependencies: {
    API: {
      getUser: () => Observable.of({ data: { name: 'キズナアイ' } }),
      getUsers: () =>
        Observable.of({
          data: [{ name: 'のじゃロリ' }, { name: 'キズナアイ' }],
        }),
    },
  },
  tests: [
    {
      title: 'FETCH_USER_SUCCESS',
      input$: '--a',
      expect$: '--b',
      values: {
        a: { type: 'FETCH_USER_REQUEST' },
        b: { type: 'FETCH_USER_SUCCESS', payload: { name: 'キズナアイ' } },
      },
    },
    {
      title: 'FETCH_USERS_SUCCESS',
      input$: '--a',
      expect$: '--b',
      values: {
        a: { type: 'FETCH_USERS_REQUEST' },
        b: {
          type: 'FETCH_USERS_SUCCESS',
          payload: [{ name: 'のじゃロリ' }, { name: 'キズナアイ' }],
        },
      },
    },
  ],
})
```

## API

### `epicTester({title, epic, state, dependencies, tests})`

#### title

Type: `string`
required: `true`<br>

test title.

#### epic

required: `true`<br>

#### state

#### dependencies

Type: `Object`<br>
Default: `{}`

#### tests

Type: `Array<{title, input$, expect$, values}>`<br>
required: `true`<br>
Default: `[]`

## Contributors

Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<!-- prettier-ignore -->
| [<img src="https://avatars2.githubusercontent.com/u/4002137?v=4" width="100px;"/><br /><sub>akameco</sub>](http://akameco.github.io)<br />[💻](https://github.com/akameco/epic-tester/commits?author=akameco "Code") [📖](https://github.com/akameco/epic-tester/commits?author=akameco "Documentation") [⚠️](https://github.com/akameco/epic-tester/commits?author=akameco "Tests") [🚇](#infra-akameco "Infrastructure (Hosting, Build-Tools, etc)") |
| :---: |

<!-- ALL-CONTRIBUTORS-LIST:END -->

This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!

## License

MIT © [akameco](http://akameco.github.io)

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