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
- Host: GitHub
- URL: https://github.com/akameco/epic-tester
- Owner: akameco
- License: mit
- Created: 2018-03-12T16:19:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-31T16:59:33.000Z (about 8 years ago)
- Last Synced: 2025-03-08T04:36:02.027Z (over 1 year ago)
- Topics: redux, redux-observable, rxjava
- Language: JavaScript
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# epic-tester
[](https://travis-ci.org/akameco/epic-tester)
[](https://github.com/facebook/jest)
[](https://github.com/prettier/prettier)
[](#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)