|
@@ -1,3 +1,4 @@
|
|
|
|
|
+"use strict";
|
|
|
var __defProp = Object.defineProperty;
|
|
var __defProp = Object.defineProperty;
|
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -171,10 +172,7 @@ function createSpy(target = void 0, methodNameOrImpl = void 0, customImplForMeth
|
|
|
__name(createSpy, "createSpy");
|
|
__name(createSpy, "createSpy");
|
|
|
|
|
|
|
|
// src/create-spies-group.js
|
|
// src/create-spies-group.js
|
|
|
-var SpiesGroup = class {
|
|
|
|
|
- static {
|
|
|
|
|
- __name(this, "SpiesGroup");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+var _SpiesGroup = class _SpiesGroup {
|
|
|
/**
|
|
/**
|
|
|
* Constructor.
|
|
* Constructor.
|
|
|
*/
|
|
*/
|
|
@@ -185,9 +183,10 @@ var SpiesGroup = class {
|
|
|
* Создает шпиона для отдельной функции
|
|
* Создает шпиона для отдельной функции
|
|
|
* или метода объекта и добавляет его в группу.
|
|
* или метода объекта и добавляет его в группу.
|
|
|
*
|
|
*
|
|
|
- * @param target
|
|
|
|
|
- * @param methodNameOrImpl
|
|
|
|
|
- * @param customImplForMethod
|
|
|
|
|
|
|
+ * @param {Function|object} [target]
|
|
|
|
|
+ * @param {Function|string} [methodNameOrImpl]
|
|
|
|
|
+ * @param {Function} [customImplForMethod]
|
|
|
|
|
+ * @returns {Function}
|
|
|
*/
|
|
*/
|
|
|
on(target, methodNameOrImpl, customImplForMethod) {
|
|
on(target, methodNameOrImpl, customImplForMethod) {
|
|
|
const spy = createSpy(target, methodNameOrImpl, customImplForMethod);
|
|
const spy = createSpy(target, methodNameOrImpl, customImplForMethod);
|
|
@@ -199,6 +198,8 @@ var SpiesGroup = class {
|
|
|
* для которых были созданы шпионы в этой группе,
|
|
* для которых были созданы шпионы в этой группе,
|
|
|
* и сброс истории вызовов для всех шпионов в группе.
|
|
* и сброс истории вызовов для всех шпионов в группе.
|
|
|
* Очищает внутренний список шпионов.
|
|
* Очищает внутренний список шпионов.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @returns {this}
|
|
|
*/
|
|
*/
|
|
|
restore() {
|
|
restore() {
|
|
|
this.spies.forEach((spy) => spy.restore());
|
|
this.spies.forEach((spy) => spy.restore());
|
|
@@ -206,6 +207,8 @@ var SpiesGroup = class {
|
|
|
return this;
|
|
return this;
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+__name(_SpiesGroup, "SpiesGroup");
|
|
|
|
|
+var SpiesGroup = _SpiesGroup;
|
|
|
function createSpiesGroup() {
|
|
function createSpiesGroup() {
|
|
|
return new SpiesGroup();
|
|
return new SpiesGroup();
|
|
|
}
|
|
}
|