a_mock 1.0.5 → 2.0.1

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.
Files changed (132) hide show
  1. package/AUTHORS +1 -1
  2. package/and/newBinaryAnd.js +19 -19
  3. package/and/newBinaryAndSpec/test.js +67 -67
  4. package/and/newMonadicAnd.js +19 -19
  5. package/and/newMonadicAndSpec/test.js +45 -45
  6. package/and.js +11 -11
  7. package/andSpec/test.js +35 -35
  8. package/andSpec/testIntegration.js +24 -24
  9. package/eventEmitter/add.js +5 -5
  10. package/eventEmitter/addSpec/test.js +22 -22
  11. package/eventEmitter/emitterContext.js +7 -7
  12. package/eventEmitter/emitterContextSpec/test.js +12 -12
  13. package/eventEmitter/remove.js +11 -11
  14. package/eventEmitter/removeSpec/test.js +27 -27
  15. package/eventEmitter/tryAdd.js +7 -7
  16. package/eventEmitter/tryAddSpec/test.js +43 -43
  17. package/eventEmitter/tryRemove.js +7 -7
  18. package/eventEmitter/tryRemoveSpec/test.js +43 -43
  19. package/eventEmitter.js +42 -42
  20. package/eventEmitterSpec/test.js +142 -142
  21. package/expectRequire.js +20 -20
  22. package/expectRequireSpec/test.js +67 -67
  23. package/index.d.ts +96 -0
  24. package/index.js +9 -10
  25. package/mock/mockContext.js +9 -9
  26. package/mock/mockContextSpec/test.js +30 -30
  27. package/mock/mockFuncProperties.js +16 -16
  28. package/mock/mockFuncPropertiesSpec/test.js +67 -67
  29. package/mock/objectMock.js +23 -23
  30. package/mock/objectMockSpec/test.js +123 -123
  31. package/mock/propertyMock.js +13 -13
  32. package/mock/propertyMockSpec/test.js +36 -36
  33. package/mock/throwUnexpectedArguments.js +13 -13
  34. package/mock/throwUnexpectedArgumentsSpec/test.js +35 -35
  35. package/mock.js +19 -19
  36. package/mockSpec/test.js +65 -65
  37. package/mockSpec/testIntegration.js +102 -102
  38. package/newMutableAnd.js +18 -18
  39. package/newMutableAndSpec/test.js +48 -48
  40. package/newObject.js +4 -4
  41. package/newThen.js +111 -111
  42. package/newThenSpec/test.js +11 -11
  43. package/newThenSpec/testExecute.js +80 -80
  44. package/newThenSpec/testNoCallback.js +57 -57
  45. package/newThenSpec/testPreReject.js +51 -51
  46. package/newThenSpec/testPreRejectAndThrow.js +50 -50
  47. package/newThenSpec/testPreResolve.js +49 -49
  48. package/newThenSpec/testPreResolveAndThrow.js +48 -48
  49. package/newThenSpec/testReject.js +56 -56
  50. package/newThenSpec/testRejectAndThrow.js +56 -56
  51. package/newThenSpec/testResolve.js +56 -56
  52. package/newThenSpec/testResolveAndThrow.js +54 -54
  53. package/newThenSpec/testResolveWithFailingPromise.js +65 -65
  54. package/newThenSpec/testResolveWithPromise.js +65 -65
  55. package/newTrueNTimesThenFalse.js +29 -29
  56. package/newTrueNTimesThenFalseSpec/test.js +59 -59
  57. package/newTrueOnceThenFalse.js +21 -21
  58. package/newTrueOnceThenFalseSpec/test.js +25 -25
  59. package/package.json +14 -13
  60. package/partialMock/execute.js +18 -18
  61. package/partialMock/executeSpec/test.js +84 -84
  62. package/partialMock/expect.js +13 -13
  63. package/partialMock/expectAnything.js +51 -51
  64. package/partialMock/expectAnythingSpec/test.js +167 -167
  65. package/partialMock/expectArray.js +11 -11
  66. package/partialMock/expectArraySpec/test.js +36 -36
  67. package/partialMock/expectCore.js +70 -70
  68. package/partialMock/expectCoreSpec/test.js +241 -241
  69. package/partialMock/expectEmpty.js +47 -47
  70. package/partialMock/expectEmptySpec/test.js +194 -194
  71. package/partialMock/expectSpec/test.js +45 -45
  72. package/partialMock/fallbackWrapper/getStackTrace.js +13 -13
  73. package/partialMock/hasSameArgument/isEqualArg.js +68 -68
  74. package/partialMock/hasSameArgument/isEqualArgSpec/test.js +283 -283
  75. package/partialMock/ignore.js +7 -7
  76. package/partialMock/ignoreSpec/test.js +30 -30
  77. package/partialMock/mockContext/reset.js +14 -14
  78. package/partialMock/mockContext/resetSpec/test.js +42 -42
  79. package/partialMock/negotiateDecrementExpectCount.js +5 -5
  80. package/partialMock/negotiateDecrementExpectCountSpec/test.js +31 -31
  81. package/partialMock/negotiateEnd.js +10 -10
  82. package/partialMock/negotiateEndSpec/test.js +64 -64
  83. package/partialMock/negotiateIncrementExpectCount.js +5 -5
  84. package/partialMock/negotiateIncrementExpectCountSpec/test.js +31 -31
  85. package/partialMock/newExecute.js +21 -21
  86. package/partialMock/newExecuteSpec/test.js +61 -61
  87. package/partialMock/newFallbackWrapper.js +30 -30
  88. package/partialMock/newFallbackWrapperSpec/test.js +70 -70
  89. package/partialMock/newFallbackWrapperSpec/testWithMockError.js +59 -59
  90. package/partialMock/newFallbackWrapperSpec/testWithOtherError.js +48 -48
  91. package/partialMock/newHasArgument.js +9 -9
  92. package/partialMock/newHasArgumentSpec/test.js +36 -36
  93. package/partialMock/newHasEqualArgumentArray.js +23 -23
  94. package/partialMock/newHasEqualArgumentArraySpec/test.js +59 -59
  95. package/partialMock/newHasNoMoreArguments.js +15 -15
  96. package/partialMock/newHasNoMoreArgumentsSpec/test.js +64 -64
  97. package/partialMock/newHasSameArgument.js +11 -11
  98. package/partialMock/newHasSameArgumentSpec/test.js +80 -80
  99. package/partialMock/newMockContext.js +12 -12
  100. package/partialMock/newMockContextSpec/test.js +36 -36
  101. package/partialMock/newThrow.js +6 -6
  102. package/partialMock/newThrowSpec/test.js +20 -20
  103. package/partialMock/return.js +24 -24
  104. package/partialMock/returnSpec/test.js +106 -106
  105. package/partialMock/setExecute.js +15 -15
  106. package/partialMock/setExecuteSpec/test.js +87 -87
  107. package/partialMock/simple/expectRequire.js +12 -12
  108. package/partialMock/simple/expectRequireSpec/test.js +41 -41
  109. package/partialMock/simple/newMock/throwUnexpectedArguments.js +9 -9
  110. package/partialMock/simple/newMock/throwUnexpectedArgumentsSpec/test.js +23 -23
  111. package/partialMock/simple/newMock.js +10 -10
  112. package/partialMock/simple/newMockSpec/test.js +28 -28
  113. package/partialMock/simple/newPartialMock.js +124 -124
  114. package/partialMock/simple/newPartialMockSpec/test.js +141 -141
  115. package/partialMock/simple/newPartialMockSpec/testRepeat.js +63 -63
  116. package/partialMock/simple/newPartialMockSpec/testWithMultiArgs.js +54 -54
  117. package/partialMock/simple/newPartialMockSpec/testWithSingleArg.js +116 -116
  118. package/partialMock/simple/newRequireMock.js +12 -12
  119. package/partialMock/simple/newRequireMockSpec/test.js +39 -39
  120. package/partialMock/verify.js +7 -7
  121. package/partialMock/verifySpec/test.js +37 -37
  122. package/partialMock.js +70 -70
  123. package/partialMockSpec/test.js +235 -235
  124. package/partialMockSpec/testIntegration.js +568 -568
  125. package/promise.js +10 -10
  126. package/requireMock.js +14 -14
  127. package/requireMockSpec/test.js +45 -45
  128. package/strictMock.js +10 -10
  129. package/strictMockSpec/test.js +28 -28
  130. package/test.js +16 -16
  131. package/util.js +7 -1
  132. package/.npmignore +0 -1
@@ -1,283 +1,283 @@
1
- var assert = require('assert');
2
- var test = require('../../../test');
3
- var newMock = require('../../simple/newMock');
4
- var newRequireMock = require('../../simple/newRequireMock');
5
-
6
- var sut = require('../isEqualArg');
7
-
8
-
9
- (function() {
10
- console.log('isEqualArg');
11
- var expectedArg = {};
12
- var index = 1;
13
-
14
- (function() {
15
- console.log('shallow.not deepEqual.execute');
16
- var arg = {};
17
- var returned = sut(expectedArg, arg);
18
-
19
- test('it should return false', function() {
20
- assert.equal(false, returned);
21
- });
22
-
23
- })();
24
-
25
- (function() {
26
- console.log('shallow.null other.execute');
27
- var arg = {};
28
- var returned = sut(null, arg);
29
-
30
- test('it should return false', function() {
31
- assert.equal(false, returned);
32
- });
33
-
34
- })();
35
-
36
-
37
- (function() {
38
- console.log('shallow.is deepEqual.execute');
39
- var returned = sut(expectedArg, expectedArg);
40
-
41
- test('it should return true', function() {
42
- assert.equal(true, returned);
43
- });
44
-
45
- })();
46
-
47
- (function() {
48
- console.log('array with incorrect length.execute');
49
- var returned = sut([], [2]);
50
-
51
- test('it should return false', function() {
52
- assert.equal(false, returned);
53
- });
54
-
55
- })();
56
-
57
-
58
- (function() {
59
- console.log('array and other type.execute');
60
- var returned = sut([2], 2);
61
-
62
- test('it should return false', function() {
63
- assert.equal(false, returned);
64
- });
65
-
66
- })();
67
-
68
- (function() {
69
- console.log('shallow.array with different contents.execute');
70
- var returned = sut([1], [2]);
71
-
72
- test('it should return false', function() {
73
- assert.equal(false, returned);
74
- });
75
-
76
- })();
77
-
78
- (function() {
79
- console.log('shallow.array with equal contents.execute');
80
- var returned = sut([expectedArg, 1, 'foo', new Buffer('abc'), new Date(2000)], [expectedArg, 1, 'foo', new Buffer('abc'), new Date(2000)]);
81
-
82
- test('it should return true', function() {
83
- assert.equal(true, returned);
84
- });
85
-
86
- })();
87
-
88
- (function() {
89
- console.log('nested.array with equal contents.execute');
90
- var returned = sut([expectedArg, [1, [2, 3]], 'foo'], [expectedArg, [1, [2, 3]], 'foo']);
91
-
92
- test('it should return true', function() {
93
- assert.equal(true, returned);
94
- });
95
- })();
96
-
97
- (function() {
98
- console.log('nested.array with non equal contents.execute');
99
- var returned = sut([expectedArg, [1, [2, 3, 4]], 'foo'], [expectedArg, [1, [2, 3]], 'foo']);
100
-
101
- test('it should return false', function() {
102
- assert.equal(false, returned);
103
- });
104
- })();
105
-
106
- (function() {
107
- console.log('struct with different architecture.execute');
108
- var returned = sut({
109
- a: 1
110
- }, {
111
- b: 1
112
- });
113
-
114
- test('it should return false', function() {
115
- assert.equal(false, returned);
116
- });
117
- })();
118
-
119
- (function() {
120
- console.log('struct with same architecture, different values.execute');
121
- var returned = sut({
122
- a: 1
123
- }, {
124
- a: 2
125
- });
126
-
127
- test('it should return false', function() {
128
- assert.equal(false, returned);
129
- });
130
- })();
131
-
132
- (function() {
133
- console.log('struct with same architecture, equal values.execute');
134
- var returned = sut({
135
- a: 1
136
- }, {
137
- a: 1
138
- });
139
-
140
- test('it should return true', function() {
141
- assert.equal(true, returned);
142
- });
143
- })();
144
-
145
- (function() {
146
- console.log('advanced struct with same architecture, equal values.execute');
147
- var Foo = function() {
148
- this.arg = 'arg';
149
- };
150
- var foo = new Foo();
151
- var foo2 = new Foo();
152
-
153
- var returned = sut({
154
- a: 1,
155
- b: [{
156
- c: 2
157
- }, foo]
158
- }, {
159
- a: 1,
160
- b: [{
161
- c: 2
162
- }, foo2]
163
- });
164
-
165
- test('it should return true', function() {
166
- assert.equal(true, returned);
167
- });
168
- })();
169
-
170
- (function() {
171
- console.log('two new objects with equal properties of same class, equal values.execute');
172
- var Foo = function() {
173
- this.arg = 'arg';
174
- };
175
- var foo = new Foo();
176
- var foo2 = new Foo();
177
-
178
- var returned = sut(foo, foo2);
179
-
180
- test('it should return true', function() {
181
- assert.equal(true, returned);
182
- });
183
- })();
184
-
185
- (function() {
186
- console.log('two new objects with non equal properties of same class, equal values.execute');
187
- var Foo = function(value) {
188
- this.arg = value;
189
- };
190
- var foo = new Foo(1);
191
- var foo2 = new Foo(2);
192
-
193
- var returned = sut(foo, foo2);
194
-
195
- test('it should return false', function() {
196
- assert.equal(false, returned);
197
- });
198
- })();
199
-
200
- (function() {
201
- console.log('two new objects of same class with no properties, equal values.execute');
202
- var Foo = function() {};
203
- var foo = new Foo();
204
- var foo2 = new Foo();
205
-
206
- var returned = sut(foo, foo2);
207
-
208
- test('it should return false', function() {
209
- assert.equal(false, returned);
210
- });
211
- })();
212
-
213
- (function() {
214
- console.log('buffers with equal contents.execute');
215
- var returned = sut(new Buffer('abc'), new Buffer('abc'));
216
-
217
- test('it should return true', function() {
218
- assert.equal(true, returned);
219
- });
220
-
221
- })();
222
-
223
- (function() {
224
- console.log('buffer and non-buffer contents.execute');
225
- var returned = sut(new Buffer('abc'), 'abc');
226
-
227
- test('it should return false', function() {
228
- assert.equal(false, returned);
229
- });
230
-
231
- })();
232
-
233
- (function() {
234
- console.log('buffers with different contents.execute');
235
- var returned = sut(new Buffer('aba'), new Buffer('abc'));
236
-
237
- test('it should return false', function() {
238
- assert.equal(false, returned);
239
- });
240
-
241
- })();
242
-
243
- (function() {
244
- console.log('buffers partly equal contents.execute');
245
- var returned = sut(new Buffer('ab'), new Buffer('abc'));
246
-
247
- test('it should return false', function() {
248
- assert.equal(false, returned);
249
- });
250
-
251
- })();
252
-
253
- (function() {
254
- console.log('equal dates.execute');
255
- var returned = sut(new Date(2015,5,24), new Date(2015,5,24));
256
-
257
- test('it should return true', function() {
258
- assert.equal(true, returned);
259
- });
260
-
261
- })();
262
-
263
- (function() {
264
- console.log('non equal dates.execute');
265
- var returned = sut(new Date(2015,5,22), new Date(2015,5,24));
266
-
267
- test('it should return false', function() {
268
- assert.equal(false, returned);
269
- });
270
-
271
- })();
272
-
273
- (function() {
274
- console.log('date and undefined.execute');
275
- var returned = sut(undefined, new Date(2015,5,24));
276
-
277
- test('it should return false', function() {
278
- assert.equal(false, returned);
279
- });
280
-
281
- })();
282
-
283
- })();
1
+ var assert = require('assert');
2
+ var test = require('../../../test');
3
+ var newMock = require('../../simple/newMock');
4
+ var newRequireMock = require('../../simple/newRequireMock');
5
+
6
+ var sut = require('../isEqualArg');
7
+
8
+
9
+ (function() {
10
+ console.log('isEqualArg');
11
+ var expectedArg = {};
12
+ var index = 1;
13
+
14
+ (function() {
15
+ console.log('shallow.not deepEqual.execute');
16
+ var arg = {};
17
+ var returned = sut(expectedArg, arg);
18
+
19
+ test('it should return false', function() {
20
+ assert.equal(false, returned);
21
+ });
22
+
23
+ })();
24
+
25
+ (function() {
26
+ console.log('shallow.null other.execute');
27
+ var arg = {};
28
+ var returned = sut(null, arg);
29
+
30
+ test('it should return false', function() {
31
+ assert.equal(false, returned);
32
+ });
33
+
34
+ })();
35
+
36
+
37
+ (function() {
38
+ console.log('shallow.is deepEqual.execute');
39
+ var returned = sut(expectedArg, expectedArg);
40
+
41
+ test('it should return true', function() {
42
+ assert.equal(true, returned);
43
+ });
44
+
45
+ })();
46
+
47
+ (function() {
48
+ console.log('array with incorrect length.execute');
49
+ var returned = sut([], [2]);
50
+
51
+ test('it should return false', function() {
52
+ assert.equal(false, returned);
53
+ });
54
+
55
+ })();
56
+
57
+
58
+ (function() {
59
+ console.log('array and other type.execute');
60
+ var returned = sut([2], 2);
61
+
62
+ test('it should return false', function() {
63
+ assert.equal(false, returned);
64
+ });
65
+
66
+ })();
67
+
68
+ (function() {
69
+ console.log('shallow.array with different contents.execute');
70
+ var returned = sut([1], [2]);
71
+
72
+ test('it should return false', function() {
73
+ assert.equal(false, returned);
74
+ });
75
+
76
+ })();
77
+
78
+ (function() {
79
+ console.log('shallow.array with equal contents.execute');
80
+ var returned = sut([expectedArg, 1, 'foo', new Buffer('abc'), new Date(2000)], [expectedArg, 1, 'foo', new Buffer('abc'), new Date(2000)]);
81
+
82
+ test('it should return true', function() {
83
+ assert.equal(true, returned);
84
+ });
85
+
86
+ })();
87
+
88
+ (function() {
89
+ console.log('nested.array with equal contents.execute');
90
+ var returned = sut([expectedArg, [1, [2, 3]], 'foo'], [expectedArg, [1, [2, 3]], 'foo']);
91
+
92
+ test('it should return true', function() {
93
+ assert.equal(true, returned);
94
+ });
95
+ })();
96
+
97
+ (function() {
98
+ console.log('nested.array with non equal contents.execute');
99
+ var returned = sut([expectedArg, [1, [2, 3, 4]], 'foo'], [expectedArg, [1, [2, 3]], 'foo']);
100
+
101
+ test('it should return false', function() {
102
+ assert.equal(false, returned);
103
+ });
104
+ })();
105
+
106
+ (function() {
107
+ console.log('struct with different architecture.execute');
108
+ var returned = sut({
109
+ a: 1
110
+ }, {
111
+ b: 1
112
+ });
113
+
114
+ test('it should return false', function() {
115
+ assert.equal(false, returned);
116
+ });
117
+ })();
118
+
119
+ (function() {
120
+ console.log('struct with same architecture, different values.execute');
121
+ var returned = sut({
122
+ a: 1
123
+ }, {
124
+ a: 2
125
+ });
126
+
127
+ test('it should return false', function() {
128
+ assert.equal(false, returned);
129
+ });
130
+ })();
131
+
132
+ (function() {
133
+ console.log('struct with same architecture, equal values.execute');
134
+ var returned = sut({
135
+ a: 1
136
+ }, {
137
+ a: 1
138
+ });
139
+
140
+ test('it should return true', function() {
141
+ assert.equal(true, returned);
142
+ });
143
+ })();
144
+
145
+ (function() {
146
+ console.log('advanced struct with same architecture, equal values.execute');
147
+ var Foo = function() {
148
+ this.arg = 'arg';
149
+ };
150
+ var foo = new Foo();
151
+ var foo2 = new Foo();
152
+
153
+ var returned = sut({
154
+ a: 1,
155
+ b: [{
156
+ c: 2
157
+ }, foo]
158
+ }, {
159
+ a: 1,
160
+ b: [{
161
+ c: 2
162
+ }, foo2]
163
+ });
164
+
165
+ test('it should return true', function() {
166
+ assert.equal(true, returned);
167
+ });
168
+ })();
169
+
170
+ (function() {
171
+ console.log('two new objects with equal properties of same class, equal values.execute');
172
+ var Foo = function() {
173
+ this.arg = 'arg';
174
+ };
175
+ var foo = new Foo();
176
+ var foo2 = new Foo();
177
+
178
+ var returned = sut(foo, foo2);
179
+
180
+ test('it should return true', function() {
181
+ assert.equal(true, returned);
182
+ });
183
+ })();
184
+
185
+ (function() {
186
+ console.log('two new objects with non equal properties of same class, equal values.execute');
187
+ var Foo = function(value) {
188
+ this.arg = value;
189
+ };
190
+ var foo = new Foo(1);
191
+ var foo2 = new Foo(2);
192
+
193
+ var returned = sut(foo, foo2);
194
+
195
+ test('it should return false', function() {
196
+ assert.equal(false, returned);
197
+ });
198
+ })();
199
+
200
+ (function() {
201
+ console.log('two new objects of same class with no properties, equal values.execute');
202
+ var Foo = function() {};
203
+ var foo = new Foo();
204
+ var foo2 = new Foo();
205
+
206
+ var returned = sut(foo, foo2);
207
+
208
+ test('it should return false', function() {
209
+ assert.equal(false, returned);
210
+ });
211
+ })();
212
+
213
+ (function() {
214
+ console.log('buffers with equal contents.execute');
215
+ var returned = sut(new Buffer('abc'), new Buffer('abc'));
216
+
217
+ test('it should return true', function() {
218
+ assert.equal(true, returned);
219
+ });
220
+
221
+ })();
222
+
223
+ (function() {
224
+ console.log('buffer and non-buffer contents.execute');
225
+ var returned = sut(new Buffer('abc'), 'abc');
226
+
227
+ test('it should return false', function() {
228
+ assert.equal(false, returned);
229
+ });
230
+
231
+ })();
232
+
233
+ (function() {
234
+ console.log('buffers with different contents.execute');
235
+ var returned = sut(new Buffer('aba'), new Buffer('abc'));
236
+
237
+ test('it should return false', function() {
238
+ assert.equal(false, returned);
239
+ });
240
+
241
+ })();
242
+
243
+ (function() {
244
+ console.log('buffers partly equal contents.execute');
245
+ var returned = sut(new Buffer('ab'), new Buffer('abc'));
246
+
247
+ test('it should return false', function() {
248
+ assert.equal(false, returned);
249
+ });
250
+
251
+ })();
252
+
253
+ (function() {
254
+ console.log('equal dates.execute');
255
+ var returned = sut(new Date(2015,5,24), new Date(2015,5,24));
256
+
257
+ test('it should return true', function() {
258
+ assert.equal(true, returned);
259
+ });
260
+
261
+ })();
262
+
263
+ (function() {
264
+ console.log('non equal dates.execute');
265
+ var returned = sut(new Date(2015,5,22), new Date(2015,5,24));
266
+
267
+ test('it should return false', function() {
268
+ assert.equal(false, returned);
269
+ });
270
+
271
+ })();
272
+
273
+ (function() {
274
+ console.log('date and undefined.execute');
275
+ var returned = sut(undefined, new Date(2015,5,24));
276
+
277
+ test('it should return false', function() {
278
+ assert.equal(false, returned);
279
+ });
280
+
281
+ })();
282
+
283
+ })();
@@ -1,8 +1,8 @@
1
- var alwaysTrue = require('../and');
2
-
3
- function ignore(index,mockContext) {
4
- var expectCore = require('./expectCore');
5
- return expectCore(alwaysTrue,index,mockContext);
6
- }
7
-
1
+ var alwaysTrue = require('../and');
2
+
3
+ function ignore(index,mockContext) {
4
+ var expectCore = require('./expectCore');
5
+ return expectCore(alwaysTrue,index,mockContext);
6
+ }
7
+
8
8
  module.exports = ignore;
@@ -1,30 +1,30 @@
1
- var assert = require('assert');
2
- var test = require('../../test');
3
- var newMock = require('../simple/newMock');
4
- var newRequireMock = require('../simple/newRequireMock');
5
-
6
- var expectCore = newRequireMock('./expectCore');
7
- var alwaysTrue = newRequireMock('../and');
8
-
9
- var sut = require('../ignore');
10
-
11
-
12
- (function(){
13
- console.log('ignore');
14
- var mockContext = {};
15
- var index = {};
16
- var expected = {};
17
-
18
- stubExpectCore();
19
-
20
- function stubExpectCore() {
21
- expectCore.expect(alwaysTrue).expect(index).expect(mockContext).return(expected);
22
- }
23
-
24
- var returned = sut(index,mockContext);
25
-
26
- test('it should return expected from expectCore',function() {
27
- assert.equal(expected,returned);
28
- });
29
-
30
- })();
1
+ var assert = require('assert');
2
+ var test = require('../../test');
3
+ var newMock = require('../simple/newMock');
4
+ var newRequireMock = require('../simple/newRequireMock');
5
+
6
+ var expectCore = newRequireMock('./expectCore');
7
+ var alwaysTrue = newRequireMock('../and');
8
+
9
+ var sut = require('../ignore');
10
+
11
+
12
+ (function(){
13
+ console.log('ignore');
14
+ var mockContext = {};
15
+ var index = {};
16
+ var expected = {};
17
+
18
+ stubExpectCore();
19
+
20
+ function stubExpectCore() {
21
+ expectCore.expect(alwaysTrue).expect(index).expect(mockContext).return(expected);
22
+ }
23
+
24
+ var returned = sut(index,mockContext);
25
+
26
+ test('it should return expected from expectCore',function() {
27
+ assert.equal(expected,returned);
28
+ });
29
+
30
+ })();
@@ -1,15 +1,15 @@
1
- var newFallbackWrapper = require('../newFallbackWrapper');
2
- var newAnd = require('../../newMutableAnd')
3
-
4
- function _new(mockContext,originalFallback) {
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
-
1
+ var newFallbackWrapper = require('../newFallbackWrapper');
2
+ var newAnd = require('../../newMutableAnd')
3
+
4
+ function _new(mockContext,originalFallback) {
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
15
  module.exports = _new;