UNPKG

@johanblumenberg/ts-mockito

Version:
32 lines 1.04 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MethodToStub = void 0; var Watcher = (function () { function Watcher(err) { var _this = this; this.err = err; this.inv = false; this.nextTick = function () { if (!_this.inv) { throw _this.err; } }; setTimeout(this.nextTick, 0); } Watcher.prototype.invoked = function () { this.inv = true; }; return Watcher; }()); var MethodToStub = (function () { function MethodToStub(methodStubCollection, matchers, mocker, methodName) { this.methodStubCollection = methodStubCollection; this.matchers = matchers; this.mocker = mocker; this.methodName = methodName; this.watcher = new Watcher(new Error("Unmatched call to " + methodName + " on a mock object, did you mean to use instance()?")); } return MethodToStub; }()); exports.MethodToStub = MethodToStub; //# sourceMappingURL=MethodToStub.js.map