1.0.8 • Published 7 years ago

rfunc-mock v1.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

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

SignatureDescription
.moduleProxy(module, options) -> ObjectCreate a proxy for a module

License

This software is released under the MIT License.

Links

1.0.8

7 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago