Skip to content

Feature: chai.spy.callsBackWith #65

@nickcarenza

Description

@nickcarenza

chai.spy.callsBackWith simply creates a spy that expects the last argument it was called with to be a callback function and calls it with the arguments provided in its constructor.

var methodA = chai.spy.callsBackWith(new Error('foo'));
methodA(cb);
// cb would be called with one argument: new Error('foo')
var methodB = chai.spy.callsBackWith(null, {id:12});
methodB(cb);
// cb would be called with two arguments: null and {id:12}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions