rfunc-mock

1.0.8 • Public • Published

rfunc-mock

Build Status Code Climate Code Coverage npm Version JS Standard

Mock utility for rfunc.

Installation

$ npm install rfunc-mock --save

Usage

'use strict'
 
const co = require('co')
const { moduleProxy } = require('rfunc-mock')
 
co(function * () {
// Create api mock
  {
    let api = moduleProxy({
      $before () {
        /* ... */
        console.log('calling the method...')
      },
      doSomething () {
        /* ... */
        return Promise.resolve('done!')
      }
    })
    yield api.doSomething()
  }
}).catch((err) => console.error(err))
 

Functions

Available functions

Signature Description
.moduleProxy(module, options) -> Object Create a proxy for a module

License

This software is released under the MIT License.

Links

Readme

Keywords

Package Sidebar

Install

npm i rfunc-mock

Weekly Downloads

1

Version

1.0.8

License

MIT

Last publish

Collaborators

  • okunishinishi