to-have-method
jasmine · javascript · matcher · unit testing

toHaveMethod npm Build Status

toHaveMethod matcher for Jasmine (http://jasmine.github.io/) to check whether object has method or not.

Installation

npm install to-have-property --save-dev

How to use

require('to-have-method');

it('should have method', function() {
    expect({ m: function() {} }).toHaveMethod('m');
});

it('should have methods', function() {
    expect({ m1: function() {}, m2: function() {} }).toHaveMethods('m1', 'm2');
});

More

others Jasmine matchers and extensions