epic-tester
v0.2.0
Published
easy Epic test
Downloads
3
Maintainers
Readme
epic-tester
simple Epic Marble Test
Install
$ yarn add --dev epic-tester
Usage
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):
This project follows the all-contributors specification. Contributions of any kind welcome!
License
MIT © akameco