a_mock 2.0.0 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +109 -0
- package/mock/mockFuncProperties.js +37 -14
- package/mock/objectMock.js +46 -21
- package/mock.js +8 -10
- package/package.json +2 -1
- package/partialMock/execute.js +10 -9
- package/partialMock/mockContext/reset.js +15 -14
- package/partialMock/newExecute.js +9 -9
- package/partialMock/newFallbackWrapper.js +29 -25
- package/partialMock/newMockContext.js +12 -12
- package/partialMock.js +10 -10
- package/util.js +7 -1
package/index.d.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
type AnyFunction = (...args: any[]) => any;
|
|
2
|
+
type Tail<T extends any[]> = T extends [any, ...infer R] ? R : [];
|
|
3
|
+
type FunctionProps<T> = T extends (...args: any[]) => any
|
|
4
|
+
? { [K in Exclude<keyof T, keyof Function>]: Mocked<T[K]> }
|
|
5
|
+
: {};
|
|
6
|
+
type MockedFunction<T extends AnyFunction> = MockFunction<
|
|
7
|
+
Parameters<T>,
|
|
8
|
+
ReturnType<T>
|
|
9
|
+
> &
|
|
10
|
+
T &
|
|
11
|
+
FunctionProps<T>;
|
|
12
|
+
|
|
13
|
+
interface RepeatControl {
|
|
14
|
+
repeat(times: number): RepeatControl;
|
|
15
|
+
repeatAny(): RepeatControl;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface ExpectationTerminal<R, TArgs extends any[]> {
|
|
19
|
+
return(value?: R): RepeatControl;
|
|
20
|
+
whenCalled(callback: (...args: TArgs) => void): ExpectationTerminal<R, TArgs>;
|
|
21
|
+
repeat(times: number): RepeatControl;
|
|
22
|
+
repeatAny(): RepeatControl;
|
|
23
|
+
throw(error: unknown): ExpectationTerminal<R, TArgs>;
|
|
24
|
+
resolve(value: any): RepeatControl;
|
|
25
|
+
reject(value: any): RepeatControl;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
interface ExpectationChain<TArgs extends any[], R>
|
|
29
|
+
extends ExpectationTerminal<R, TArgs> {
|
|
30
|
+
expect(arg: TArgs[0]): ExpectationChain<Tail<TArgs>, R>;
|
|
31
|
+
expectAnything(): ExpectationChain<Tail<TArgs>, R>;
|
|
32
|
+
ignore(): ExpectationChain<Tail<TArgs>, R>;
|
|
33
|
+
expectArray(
|
|
34
|
+
value: TArgs[0] extends any[] ? TArgs[0] : any[]
|
|
35
|
+
): ExpectationChain<Tail<TArgs>, R>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface MockFunction<TArgs extends any[], R> {
|
|
39
|
+
(...args: TArgs): R;
|
|
40
|
+
// Allow any-args calls in addition to the original signature.
|
|
41
|
+
(...args: any[]): any;
|
|
42
|
+
expect(): ExpectationTerminal<R, TArgs>;
|
|
43
|
+
expect(...args: TArgs): ExpectationTerminal<R, TArgs>;
|
|
44
|
+
expect(arg: TArgs[0]): ExpectationChain<Tail<TArgs>, R>;
|
|
45
|
+
expectAnything(): ExpectationChain<Tail<TArgs>, R>;
|
|
46
|
+
ignore(): ExpectationChain<Tail<TArgs>, R>;
|
|
47
|
+
expectArray(
|
|
48
|
+
value: TArgs[0] extends any[] ? TArgs[0] : any[]
|
|
49
|
+
): ExpectationChain<Tail<TArgs>, R>;
|
|
50
|
+
// Allow any-args expectations in addition to typed expectations.
|
|
51
|
+
expect(...args: any[]): ExpectationTerminal<any, any[]>;
|
|
52
|
+
verify(): true;
|
|
53
|
+
reset(): void;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type Mocked<T> = T extends AnyFunction
|
|
57
|
+
? MockedFunction<T>
|
|
58
|
+
: T extends object
|
|
59
|
+
? { [K in keyof T]: Mocked<T[K]> } & { verify: () => true }
|
|
60
|
+
: T;
|
|
61
|
+
|
|
62
|
+
interface RequireExpectation {
|
|
63
|
+
return(value: any): RequireExpectation;
|
|
64
|
+
repeat(times: number): RequireExpectation;
|
|
65
|
+
repeatAny(): RequireExpectation;
|
|
66
|
+
whenCalled(callback: (...args: any[]) => void): RequireExpectation;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
interface ThenableMock<T = any> {
|
|
70
|
+
(valueToResolveWith?: T | null, errorToFailWith?: any): ThenableMock<T>;
|
|
71
|
+
then<U = T>(
|
|
72
|
+
success?: (value: T) => U | ThenableMock<U> | PromiseLike<U>,
|
|
73
|
+
fail?: (error: any) => U | ThenableMock<U> | PromiseLike<U>
|
|
74
|
+
): ThenableMock<U>;
|
|
75
|
+
resolve(value?: T): ThenableMock<T>;
|
|
76
|
+
reject(error: any): ThenableMock<never>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
declare function mock<TArgs extends any[] = any[], R = any>(): MockFunction<
|
|
80
|
+
TArgs,
|
|
81
|
+
R
|
|
82
|
+
>;
|
|
83
|
+
declare function mock<T extends AnyFunction>(
|
|
84
|
+
original: T
|
|
85
|
+
): MockedFunction<T>;
|
|
86
|
+
declare function mock<T extends object>(subject: T): Mocked<T>;
|
|
87
|
+
|
|
88
|
+
declare function expectRequire(moduleName: string): RequireExpectation;
|
|
89
|
+
declare namespace expectRequire {
|
|
90
|
+
function reset(): void;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
declare function requireMock<TArgs extends any[] = any[], R = any>(
|
|
94
|
+
moduleName: string
|
|
95
|
+
): MockFunction<TArgs, R>;
|
|
96
|
+
declare namespace requireMock {
|
|
97
|
+
function reset(): void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
declare function promise<T = any>(): ThenableMock<T>;
|
|
101
|
+
|
|
102
|
+
declare const aMock: {
|
|
103
|
+
mock: typeof mock;
|
|
104
|
+
expectRequire: typeof expectRequire;
|
|
105
|
+
requireMock: typeof requireMock;
|
|
106
|
+
promise: typeof promise;
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export = aMock;
|
|
@@ -1,16 +1,39 @@
|
|
|
1
|
-
var propertyMock = require('./propertyMock');
|
|
2
|
-
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
var propertyMock = require('./propertyMock');
|
|
2
|
+
|
|
3
|
+
function collectPropertyNames(subject) {
|
|
4
|
+
var names = {};
|
|
5
|
+
for (var name in subject) {
|
|
6
|
+
names[name] = true;
|
|
7
|
+
}
|
|
8
|
+
var proto = Object.getPrototypeOf(subject);
|
|
9
|
+
while (proto && proto !== Object.prototype && proto !== Function.prototype) {
|
|
10
|
+
var props = Object.getOwnPropertyNames(proto);
|
|
11
|
+
for (var i = 0; i < props.length; i++) {
|
|
12
|
+
var prop = props[i];
|
|
13
|
+
if (prop === 'constructor' || names[prop])
|
|
14
|
+
continue;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
16
|
+
if (desc && typeof desc.value === 'function')
|
|
17
|
+
names[prop] = true;
|
|
18
|
+
}
|
|
19
|
+
proto = Object.getPrototypeOf(proto);
|
|
20
|
+
}
|
|
21
|
+
return Object.keys(names);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function execute(subject,mockObject) {
|
|
25
|
+
if (!(subject instanceof Object))
|
|
26
|
+
return;
|
|
27
|
+
var mockFuncProperties = require('./mockFuncProperties');
|
|
28
|
+
var propertyNames = collectPropertyNames(subject);
|
|
29
|
+
for(var i = 0; i < propertyNames.length; i++) {
|
|
30
|
+
var propertyName = propertyNames[i];
|
|
31
|
+
var property = subject[propertyName];
|
|
32
|
+
var mockProperty = mockObject[propertyName];
|
|
33
|
+
if (property instanceof Function)
|
|
34
|
+
subject[propertyName] = propertyMock(subject,propertyName,mockProperty);
|
|
35
|
+
mockFuncProperties(property,mockProperty);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
15
38
|
|
|
16
39
|
module.exports = execute;
|
package/mock/objectMock.js
CHANGED
|
@@ -1,23 +1,48 @@
|
|
|
1
|
-
var newMockContext = require('./mockContext');
|
|
2
|
-
var newPartialMock = require('../partialMock');
|
|
3
|
-
|
|
4
|
-
function
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
1
|
+
var newMockContext = require('./mockContext');
|
|
2
|
+
var newPartialMock = require('../partialMock');
|
|
3
|
+
|
|
4
|
+
function collectPropertyNames(subject) {
|
|
5
|
+
var names = {};
|
|
6
|
+
for (var name in subject) {
|
|
7
|
+
names[name] = true;
|
|
8
|
+
}
|
|
9
|
+
var proto = Object.getPrototypeOf(subject);
|
|
10
|
+
while (proto && proto !== Object.prototype && proto !== Function.prototype) {
|
|
11
|
+
var props = Object.getOwnPropertyNames(proto);
|
|
12
|
+
for (var i = 0; i < props.length; i++) {
|
|
13
|
+
var prop = props[i];
|
|
14
|
+
if (prop === 'constructor' || names[prop])
|
|
15
|
+
continue;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(proto, prop);
|
|
17
|
+
if (desc && typeof desc.value === 'function')
|
|
18
|
+
names[prop] = true;
|
|
19
|
+
}
|
|
20
|
+
proto = Object.getPrototypeOf(proto);
|
|
21
|
+
}
|
|
22
|
+
return Object.keys(names);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function _new(subject,mockContext,parent) {
|
|
26
|
+
var newObjectMock = require('./objectMock');
|
|
27
|
+
|
|
28
|
+
var mockContext = newMockContext(mockContext);
|
|
29
|
+
var mock = {};
|
|
30
|
+
mock.verify = mockContext.verify;
|
|
31
|
+
if (subject instanceof Function) {
|
|
32
|
+
mock = newPartialMock(subject, parent);
|
|
33
|
+
mockContext.verify.add(mock.verify);
|
|
34
|
+
}
|
|
35
|
+
if (!(subject instanceof Object))
|
|
36
|
+
return mock;
|
|
37
|
+
var propertyNames = collectPropertyNames(subject);
|
|
38
|
+
for(var i = 0; i < propertyNames.length; i++) {
|
|
39
|
+
var propertyName = propertyNames[i];
|
|
40
|
+
if (Object.prototype.hasOwnProperty.call(mock, propertyName))
|
|
41
|
+
continue;
|
|
42
|
+
var property = subject[propertyName];
|
|
43
|
+
mock[propertyName] = newObjectMock(property,mockContext,subject);
|
|
44
|
+
}
|
|
45
|
+
return mock;
|
|
46
|
+
}
|
|
22
47
|
|
|
23
48
|
module.exports = _new
|
package/mock.js
CHANGED
|
@@ -3,16 +3,14 @@ var newObjectMock = require('./mock/objectMock');
|
|
|
3
3
|
var newPartialMock = require('./partialMock')
|
|
4
4
|
var mockFuncProperties = require('./mock/mockFuncProperties')
|
|
5
5
|
|
|
6
|
-
function create(subject) {
|
|
7
|
-
if (subject == undefined)
|
|
8
|
-
return newStrictMock();
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
6
|
+
function create(subject) {
|
|
7
|
+
if (subject == undefined)
|
|
8
|
+
return newStrictMock();
|
|
9
|
+
var mock = newObjectMock(subject);
|
|
10
|
+
mockFuncProperties(subject,mock);
|
|
11
|
+
return mock;
|
|
12
|
+
|
|
13
|
+
}
|
|
16
14
|
|
|
17
15
|
module.exports = create;
|
|
18
16
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "a_mock",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"main": "index.js",
|
|
5
|
+
"types": "index.d.ts",
|
|
5
6
|
"title": "a_mock",
|
|
6
7
|
"description": "Sub package of a. Mocking framework",
|
|
7
8
|
"keywords": ["mock","mocking","partial mock","strict mock","tdd","stub","stubbing","mock require","verify"],
|
package/partialMock/execute.js
CHANGED
|
@@ -7,13 +7,14 @@ function execute(returnValue,fallback,hasCorrectArguments,mockContext,shouldDecr
|
|
|
7
7
|
args.push(arguments[index]);
|
|
8
8
|
index++;
|
|
9
9
|
}
|
|
10
|
-
if (hasCorrectArguments.apply(null,args)) {
|
|
11
|
-
negotiateDecrementExpectCount(shouldDecrementExpectCount,mockContext);
|
|
12
|
-
whenCalledEmitter.emit.apply(null,args);
|
|
13
|
-
return returnValue;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
if (hasCorrectArguments.apply(null,args)) {
|
|
11
|
+
negotiateDecrementExpectCount(shouldDecrementExpectCount,mockContext);
|
|
12
|
+
whenCalledEmitter.emit.apply(null,args);
|
|
13
|
+
return returnValue;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
var receiver = mockContext && mockContext.thisArg != null ? mockContext.thisArg : this;
|
|
17
|
+
return fallback.apply(receiver,args);
|
|
18
|
+
}
|
|
18
19
|
|
|
19
|
-
module.exports = execute;
|
|
20
|
+
module.exports = execute;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
var newFallbackWrapper = require('../newFallbackWrapper');
|
|
2
|
-
var newAnd = require('../../newMutableAnd')
|
|
1
|
+
var newFallbackWrapper = require('../newFallbackWrapper');
|
|
2
|
+
var newAnd = require('../../newMutableAnd')
|
|
3
|
+
|
|
4
|
+
function _new(mockContext,originalFallback,thisArg) {
|
|
5
|
+
var and = newAnd();
|
|
6
|
+
mockContext.execute = newFallbackWrapper(originalFallback, thisArg);
|
|
7
|
+
mockContext.originalFallback = originalFallback;
|
|
8
|
+
mockContext.thisArg = thisArg;
|
|
9
|
+
mockContext.lastExecute = mockContext.execute;
|
|
10
|
+
mockContext.compositeAreCorrectArguments = and;
|
|
11
|
+
mockContext.expectCount = 0;
|
|
12
|
+
|
|
13
|
+
return mockContext;
|
|
14
|
+
}
|
|
3
15
|
|
|
4
|
-
|
|
5
|
-
var and = newAnd();
|
|
6
|
-
mockContext.execute = newFallbackWrapper(originalFallback);
|
|
7
|
-
mockContext.originalFallback = originalFallback;
|
|
8
|
-
mockContext.lastExecute = mockContext.execute;
|
|
9
|
-
mockContext.compositeAreCorrectArguments = and;
|
|
10
|
-
mockContext.expectCount = 0;
|
|
11
|
-
|
|
12
|
-
return mockContext;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
module.exports = _new;
|
|
16
|
+
module.exports = _new;
|
|
@@ -3,14 +3,14 @@ function newExecute(returnValue,hasCorrectArguments,mockContext,shouldDecrementE
|
|
|
3
3
|
var _fallback = mockContext.originalFallback;
|
|
4
4
|
var whenCalledEmitter = mockContext.whenCalledEmitter;
|
|
5
5
|
|
|
6
|
-
function execute() {
|
|
7
|
-
var args = [returnValue,_fallback,hasCorrectArguments,mockContext,shouldDecrementExpectCount,whenCalledEmitter];
|
|
8
|
-
for(var index = 0; index < arguments.length; index++) {
|
|
9
|
-
args.push(arguments[index]);
|
|
10
|
-
}
|
|
11
|
-
return _execute.apply(
|
|
12
|
-
returnValue,fallback,hasCorrectArguments
|
|
13
|
-
}
|
|
6
|
+
function execute() {
|
|
7
|
+
var args = [returnValue,_fallback,hasCorrectArguments,mockContext,shouldDecrementExpectCount,whenCalledEmitter];
|
|
8
|
+
for(var index = 0; index < arguments.length; index++) {
|
|
9
|
+
args.push(arguments[index]);
|
|
10
|
+
}
|
|
11
|
+
return _execute.apply(this,args);
|
|
12
|
+
returnValue,fallback,hasCorrectArguments
|
|
13
|
+
}
|
|
14
14
|
|
|
15
15
|
execute.setFallback = function(fallback) {
|
|
16
16
|
_fallback = fallback;
|
|
@@ -19,4 +19,4 @@ function newExecute(returnValue,hasCorrectArguments,mockContext,shouldDecrementE
|
|
|
19
19
|
return execute;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
module.exports = newExecute;
|
|
22
|
+
module.exports = newExecute;
|
|
@@ -1,31 +1,35 @@
|
|
|
1
|
-
var getStackTrace = require('./fallbackWrapper/getStackTrace');
|
|
2
|
-
|
|
3
|
-
function _new(originalFallback) {
|
|
4
|
-
|
|
5
|
-
var fallback = originalFallback;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
var getStackTrace = require('./fallbackWrapper/getStackTrace');
|
|
2
|
+
|
|
3
|
+
function _new(originalFallback, thisArg) {
|
|
4
|
+
|
|
5
|
+
var fallback = originalFallback;
|
|
6
|
+
var fallbackThis = thisArg;
|
|
7
|
+
|
|
8
|
+
function execute() {
|
|
9
|
+
Error.stackTraceLimit = Error.stackTraceLimit + 2;
|
|
10
|
+
try {
|
|
11
|
+
var receiver = fallbackThis != null ? fallbackThis : this;
|
|
12
|
+
return fallback.apply(receiver,arguments);
|
|
13
|
+
}
|
|
14
|
+
catch (e) {
|
|
15
|
+
if (e.name == 'Mock Error') {
|
|
16
|
+
e.stack = e.name + ': ' + e.message + '\n' + getStackTrace();
|
|
17
|
+
}
|
|
16
18
|
throw e;
|
|
17
19
|
}
|
|
18
20
|
finally {
|
|
19
21
|
Error.stackTraceLimit = Error.stackTraceLimit - 2;
|
|
20
22
|
}
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
execute.setFallback = function(fallback2) {
|
|
25
|
-
fallback = fallback2;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
execute.setFallback = function(fallback2, thisArg2) {
|
|
27
|
+
fallback = fallback2;
|
|
28
|
+
if (arguments.length > 1)
|
|
29
|
+
fallbackThis = thisArg2;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
return execute;
|
|
33
|
+
}
|
|
30
34
|
|
|
31
|
-
module.exports = _new;
|
|
35
|
+
module.exports = _new;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var newObject = require('../newObject')
|
|
2
|
-
var reset = require('./mockContext/reset');
|
|
1
|
+
var newObject = require('../newObject')
|
|
2
|
+
var reset = require('./mockContext/reset');
|
|
3
|
+
|
|
4
|
+
function _new(originalFallback, thisArg) {
|
|
5
|
+
var c = newObject();
|
|
6
|
+
c = reset(c,originalFallback,thisArg);
|
|
7
|
+
c.reset = function() {
|
|
8
|
+
return reset(c, originalFallback, thisArg);
|
|
9
|
+
};
|
|
10
|
+
return c;
|
|
11
|
+
}
|
|
3
12
|
|
|
4
|
-
|
|
5
|
-
var c = newObject();
|
|
6
|
-
c = reset(c,originalFallback);
|
|
7
|
-
c.reset = function() {
|
|
8
|
-
return reset(c, originalFallback);
|
|
9
|
-
};
|
|
10
|
-
return c;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = _new;
|
|
13
|
+
module.exports = _new;
|
package/partialMock.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function create(originalFunc) {
|
|
2
|
-
var newMockContext = require('./partialMock/newMockContext');
|
|
1
|
+
function create(originalFunc, thisArg) {
|
|
2
|
+
var newMockContext = require('./partialMock/newMockContext');
|
|
3
3
|
var expect = require('./partialMock/expect');
|
|
4
4
|
var expectAnything = require('./partialMock/expectAnything');
|
|
5
5
|
var ignore = require('./partialMock/ignore');
|
|
@@ -7,14 +7,14 @@ function create(originalFunc) {
|
|
|
7
7
|
var verify = require('./partialMock/verify');
|
|
8
8
|
var expectEmpty = require('./partialMock/expectEmpty');
|
|
9
9
|
var newEmptyAnd = require('./newMutableAnd');
|
|
10
|
-
var mockContext = newMockContext(originalFunc);
|
|
11
|
-
var _negotiateEnd = require('./partialMock/negotiateEnd');
|
|
12
|
-
|
|
13
|
-
function mock() {
|
|
14
|
-
negotiateEnd();
|
|
15
|
-
mockContext.arguments = arguments;
|
|
16
|
-
return mockContext.execute.apply(
|
|
17
|
-
}
|
|
10
|
+
var mockContext = newMockContext(originalFunc, thisArg);
|
|
11
|
+
var _negotiateEnd = require('./partialMock/negotiateEnd');
|
|
12
|
+
|
|
13
|
+
function mock() {
|
|
14
|
+
negotiateEnd();
|
|
15
|
+
mockContext.arguments = arguments;
|
|
16
|
+
return mockContext.execute.apply(this,arguments);
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
mock.expect = function() {
|
|
20
20
|
negotiateEnd();
|