UNPKG

660 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const lodash_1 = require("./wrap/lodash");
4const create_1 = require("./matchers/create");
5const callback = (0, create_1.default)({
6 name: 'callback',
7 matches(matcherArgs, actual) {
8 return lodash_1.default.isFunction(actual);
9 },
10 onCreate(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;