UNPKG

671 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var lodash_1 = require("./wrap/lodash");
4var create_1 = require("./matchers/create");
5var callback = create_1.default({
6 name: 'callback',
7 matches: function (matcherArgs, actual) {
8 return lodash_1.default.isFunction(actual);
9 },
10 onCreate: function (matcherInstance, matcherArgs) {
11 matcherInstance.args = matcherArgs;
12 matcherInstance.__testdouble_callback = true;
13 }
14});
15// Make callback itself quack like a matcher for its non-invoked use case.
16callback.__name = 'callback';
17callback.__matches = lodash_1.default.isFunction;
18exports.default = callback;