An open API service indexing awesome lists of open source software.

https://github.com/akameco/epic-tester

easy Epic test
https://github.com/akameco/epic-tester

redux redux-observable rxjava

Last synced: 19 days ago
JSON representation

easy Epic test

Awesome Lists containing this project

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`

test title.

#### epic

required: `true`

#### state

#### dependencies

Type: `Object`

Default: `{}`

#### tests

Type: `Array<{title, input$, expect$, values}>`

required: `true`

Default: `[]`

## Contributors

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

| [
akameco](http://akameco.github.io)
[💻](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)") |
| :---: |

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)