create-epic-test

0.1.2 • Public • Published

create-epic-test

Build Status tested with jest styled with prettier All Contributors

create epic test

Install

$ yarn add --dev create-epic-test

Usage

const { createEpicTest } = require('create-epic-test')

const successTest = createEpicTest(epic, {
  API: {
    getUser: () => Observable.of({ data: { name: 'キズナアイ' } }),
    getUsers: () =>
      Observable.of({
        data: [{ name: 'のじゃロリ' }, { name: 'キズナアイ' }],
      }),
  },
})

successTest('APIが成功したとき、FETCH_USER_SUCCESSを発行する', {
  input$: '--a',
  expect$: '--b',
  values: {
    a: { type: 'FETCH_USER_REQUEST' },
    b: { type: 'FETCH_USER_SUCCESS', payload: { name: 'キズナアイ' } },
  },
})

successTest('APIが成功したとき、FETCH_USERS_SUCCESSを発行する', {
  input$: '--a',
  expect$: '--b',
  values: {
    a: { type: 'FETCH_USERS_REQUEST' },
    b: {
      type: 'FETCH_USERS_SUCCESS',
      payload: [{ name: 'のじゃロリ' }, { name: 'キズナアイ' }],
    },
  },
})

API

createEpicTest(epic, dependencies)

Contributors

Thanks goes to these wonderful people (emoji key):


akameco

💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco

Package Sidebar

Install

npm i create-epic-test

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

5.73 kB

Total Files

7

Last publish

Collaborators

  • akameco