@djforth/jasmine-call-helpers

Jasmine Check calls helper

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
00Oct 12, 2017Oct 19, 2016Minified + gzip package size for @djforth/jasmine-call-helpers in KB

Readme

jasmine-call-helpers

A call helper designed to work with @djforth/stubs-spy-manager

Install:

yarn -D @djforth/jasmine-call-helpers

Set up

import SpyManager from '@djforth/stubs-spy-manager';
import JasmineCallHelper from '@djforth/jasmine-call-helpers'
import MyModule from './path/to/my_module';

let spies_stubs = SpyManager(MyModule);
let callHelper = JasmineCallHelper(spies_stubs);

describe('My Tests', ()=>{
  beforeEach(()=>{
    spies_stubs.add([
      {
        stub: 'bar'
      }
      , {
        stub: 'foo'
      }
    ]).make();

    MyModule(); //Assuming foo and bar are called
  });

  afterEach(()=>{
    spies_stubs.reset();
  });

  let calls = [
    ['foo', ()=>['some attribute']]
    , ['bar', ()=>['some attribute']]
  ];
  callHelper.add(calls);
  callHelper.checkCalls();
  callHelper.reset();
})

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.