jasmine-core 2.4.1 → 2.5.0
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.
- checksums.yaml +4 -4
- data/lib/console/console.js +1 -1
- data/lib/jasmine-core/boot.js +1 -1
- data/lib/jasmine-core/jasmine-html.js +15 -7
- data/lib/jasmine-core/jasmine.js +261 -82
- data/lib/jasmine-core/node_boot.js +1 -1
- data/lib/jasmine-core/spec/console/ConsoleReporterSpec.js +16 -16
- data/lib/jasmine-core/spec/core/CallTrackerSpec.js +26 -11
- data/lib/jasmine-core/spec/core/ClockSpec.js +61 -42
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +28 -15
- data/lib/jasmine-core/spec/core/EnvSpec.js +8 -8
- data/lib/jasmine-core/spec/core/ExceptionFormatterSpec.js +6 -6
- data/lib/jasmine-core/spec/core/ExceptionsSpec.js +1 -1
- data/lib/jasmine-core/spec/core/ExpectationResultSpec.js +8 -8
- data/lib/jasmine-core/spec/core/ExpectationSpec.js +17 -17
- data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +14 -14
- data/lib/jasmine-core/spec/core/MockDateSpec.js +14 -14
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +65 -56
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +32 -18
- data/lib/jasmine-core/spec/core/ReportDispatcherSpec.js +27 -3
- data/lib/jasmine-core/spec/core/SpecSpec.js +37 -37
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +46 -7
- data/lib/jasmine-core/spec/core/SpySpec.js +11 -11
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +25 -13
- data/lib/jasmine-core/spec/core/SuiteSpec.js +25 -25
- data/lib/jasmine-core/spec/core/TimerSpec.js +2 -2
- data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +26 -26
- data/lib/jasmine-core/spec/core/UtilSpec.js +12 -12
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +8 -8
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js +7 -7
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js +6 -6
- data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +11 -11
- data/lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js +4 -4
- data/lib/jasmine-core/spec/core/formatErrorMsgSpec.js +13 -0
- data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +2 -2
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +195 -76
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +20 -21
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +164 -114
- data/lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js +4 -4
- data/lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanOrEqualSpec.js +29 -0
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js +29 -0
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js +3 -3
- data/lib/jasmine-core/spec/core/matchers/toBeNullSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeTruthySpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toBeUndefinedSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toContainSpec.js +4 -4
- data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +2 -2
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledSpec.js +11 -11
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js +22 -17
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledWithSpec.js +11 -10
- data/lib/jasmine-core/spec/core/matchers/toMatchSpec.js +7 -6
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +24 -24
- data/lib/jasmine-core/spec/core/matchers/toThrowSpec.js +9 -8
- data/lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js +3 -3
- data/lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js +5 -5
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +95 -59
- data/lib/jasmine-core/spec/html/HtmlSpecFilterSpec.js +3 -3
- data/lib/jasmine-core/spec/html/MatchersHtmlSpec.js +1 -1
- data/lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js +4 -4
- data/lib/jasmine-core/spec/html/QueryStringSpec.js +5 -5
- data/lib/jasmine-core/spec/html/ResultsNodeSpec.js +4 -4
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +2 -2
- data/lib/jasmine-core/spec/performance/large_object_test.js +1 -1
- data/lib/jasmine-core/version.rb +1 -1
- metadata +5 -3
- data/lib/jasmine-core/spec/node_suite.js +0 -195
@@ -1,20 +1,20 @@
|
|
1
1
|
describe("SpyStrategy", function() {
|
2
2
|
|
3
3
|
it("defaults its name to unknown", function() {
|
4
|
-
var spyStrategy = new
|
4
|
+
var spyStrategy = new jasmineUnderTest.SpyStrategy();
|
5
5
|
|
6
6
|
expect(spyStrategy.identity()).toEqual("unknown");
|
7
7
|
});
|
8
8
|
|
9
9
|
it("takes a name", function() {
|
10
|
-
var spyStrategy = new
|
10
|
+
var spyStrategy = new jasmineUnderTest.SpyStrategy({name: "foo"});
|
11
11
|
|
12
12
|
expect(spyStrategy.identity()).toEqual("foo");
|
13
13
|
});
|
14
14
|
|
15
15
|
it("stubs an original function, if provided", function() {
|
16
16
|
var originalFn = jasmine.createSpy("original"),
|
17
|
-
spyStrategy = new
|
17
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn});
|
18
18
|
|
19
19
|
spyStrategy.exec();
|
20
20
|
|
@@ -23,7 +23,7 @@ describe("SpyStrategy", function() {
|
|
23
23
|
|
24
24
|
it("allows an original function to be called, passed through the params and returns it's value", function() {
|
25
25
|
var originalFn = jasmine.createSpy("original").and.returnValue(42),
|
26
|
-
spyStrategy = new
|
26
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}),
|
27
27
|
returnValue;
|
28
28
|
|
29
29
|
spyStrategy.callThrough();
|
@@ -36,7 +36,7 @@ describe("SpyStrategy", function() {
|
|
36
36
|
|
37
37
|
it("can return a specified value when executed", function() {
|
38
38
|
var originalFn = jasmine.createSpy("original"),
|
39
|
-
spyStrategy = new
|
39
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}),
|
40
40
|
returnValue;
|
41
41
|
|
42
42
|
spyStrategy.returnValue(17);
|
@@ -48,7 +48,7 @@ describe("SpyStrategy", function() {
|
|
48
48
|
|
49
49
|
it("can return specified values in order specified when executed", function() {
|
50
50
|
var originalFn = jasmine.createSpy("original"),
|
51
|
-
spyStrategy = new
|
51
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn});
|
52
52
|
|
53
53
|
spyStrategy.returnValues('value1', 'value2', 'value3');
|
54
54
|
|
@@ -61,7 +61,7 @@ describe("SpyStrategy", function() {
|
|
61
61
|
|
62
62
|
it("allows an exception to be thrown when executed", function() {
|
63
63
|
var originalFn = jasmine.createSpy("original"),
|
64
|
-
spyStrategy = new
|
64
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn});
|
65
65
|
|
66
66
|
spyStrategy.throwError(new TypeError("bar"));
|
67
67
|
|
@@ -71,7 +71,7 @@ describe("SpyStrategy", function() {
|
|
71
71
|
|
72
72
|
it("allows a non-Error to be thrown, wrapping it into an exception when executed", function() {
|
73
73
|
var originalFn = jasmine.createSpy("original"),
|
74
|
-
spyStrategy = new
|
74
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn});
|
75
75
|
|
76
76
|
spyStrategy.throwError("bar");
|
77
77
|
|
@@ -82,7 +82,7 @@ describe("SpyStrategy", function() {
|
|
82
82
|
it("allows a fake function to be called instead", function() {
|
83
83
|
var originalFn = jasmine.createSpy("original"),
|
84
84
|
fakeFn = jasmine.createSpy("fake").and.returnValue(67),
|
85
|
-
spyStrategy = new
|
85
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}),
|
86
86
|
returnValue;
|
87
87
|
|
88
88
|
spyStrategy.callFake(fakeFn);
|
@@ -92,10 +92,22 @@ describe("SpyStrategy", function() {
|
|
92
92
|
expect(returnValue).toEqual(67);
|
93
93
|
});
|
94
94
|
|
95
|
+
it('throws an error when a non-function is passed to callFake strategy', function() {
|
96
|
+
var originalFn = jasmine.createSpy('original'),
|
97
|
+
invalidFakes = [5, 'foo', {}, true, false, null, void 0, new Date(), /.*/];
|
98
|
+
|
99
|
+
for (var i=0; i<invalidFakes.length; i++) {
|
100
|
+
var invalidFake = invalidFakes[i],
|
101
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn});
|
102
|
+
|
103
|
+
expect(function() {spyStrategy.callFake(invalidFake);}).toThrowError('Argument passed to callFake should be a function, got ' + invalidFake);
|
104
|
+
}
|
105
|
+
});
|
106
|
+
|
95
107
|
it("allows a return to plan stubbing after another strategy", function() {
|
96
108
|
var originalFn = jasmine.createSpy("original"),
|
97
109
|
fakeFn = jasmine.createSpy("fake").and.returnValue(67),
|
98
|
-
spyStrategy = new
|
110
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({fn: originalFn}),
|
99
111
|
returnValue;
|
100
112
|
|
101
113
|
spyStrategy.callFake(fakeFn);
|
@@ -103,7 +115,7 @@ describe("SpyStrategy", function() {
|
|
103
115
|
|
104
116
|
expect(originalFn).not.toHaveBeenCalled();
|
105
117
|
expect(returnValue).toEqual(67);
|
106
|
-
|
118
|
+
|
107
119
|
spyStrategy.stub();
|
108
120
|
returnValue = spyStrategy.exec();
|
109
121
|
|
@@ -113,12 +125,12 @@ describe("SpyStrategy", function() {
|
|
113
125
|
it("returns the spy after changing the strategy", function(){
|
114
126
|
var spy = {},
|
115
127
|
spyFn = jasmine.createSpy('spyFn').and.returnValue(spy),
|
116
|
-
spyStrategy = new
|
128
|
+
spyStrategy = new jasmineUnderTest.SpyStrategy({getSpy: spyFn});
|
117
129
|
|
118
130
|
expect(spyStrategy.callThrough()).toBe(spy);
|
119
131
|
expect(spyStrategy.returnValue()).toBe(spy);
|
120
132
|
expect(spyStrategy.throwError()).toBe(spy);
|
121
|
-
expect(spyStrategy.callFake()).toBe(spy);
|
133
|
+
expect(spyStrategy.callFake(function() {})).toBe(spy);
|
122
134
|
expect(spyStrategy.stub()).toBe(spy);
|
123
135
|
});
|
124
136
|
});
|
@@ -1,8 +1,8 @@
|
|
1
1
|
describe("Suite", function() {
|
2
2
|
|
3
3
|
it("keeps its id", function() {
|
4
|
-
var env = new
|
5
|
-
suite = new
|
4
|
+
var env = new jasmineUnderTest.Env(),
|
5
|
+
suite = new jasmineUnderTest.Suite({
|
6
6
|
env: env,
|
7
7
|
id: 456,
|
8
8
|
description: "I am a suite"
|
@@ -11,24 +11,24 @@ describe("Suite", function() {
|
|
11
11
|
expect(suite.id).toEqual(456);
|
12
12
|
});
|
13
13
|
|
14
|
-
it("returns
|
15
|
-
var env = new
|
16
|
-
suite = new
|
14
|
+
it("returns blank full name for top level suite", function() {
|
15
|
+
var env = new jasmineUnderTest.Env(),
|
16
|
+
suite = new jasmineUnderTest.Suite({
|
17
17
|
env: env,
|
18
18
|
description: "I am a suite"
|
19
19
|
});
|
20
20
|
|
21
|
-
expect(suite.getFullName()).toEqual("
|
21
|
+
expect(suite.getFullName()).toEqual("");
|
22
22
|
});
|
23
23
|
|
24
24
|
it("returns its full name when it has parent suites", function() {
|
25
|
-
var env = new
|
26
|
-
parentSuite = new
|
25
|
+
var env = new jasmineUnderTest.Env(),
|
26
|
+
parentSuite = new jasmineUnderTest.Suite({
|
27
27
|
env: env,
|
28
28
|
description: "I am a parent suite",
|
29
29
|
parentSuite: jasmine.createSpy('pretend top level suite')
|
30
30
|
}),
|
31
|
-
suite = new
|
31
|
+
suite = new jasmineUnderTest.Suite({
|
32
32
|
env: env,
|
33
33
|
description: "I am a suite",
|
34
34
|
parentSuite: parentSuite
|
@@ -38,8 +38,8 @@ describe("Suite", function() {
|
|
38
38
|
});
|
39
39
|
|
40
40
|
it("adds before functions in order of needed execution", function() {
|
41
|
-
var env = new
|
42
|
-
suite = new
|
41
|
+
var env = new jasmineUnderTest.Env(),
|
42
|
+
suite = new jasmineUnderTest.Suite({
|
43
43
|
env: env,
|
44
44
|
description: "I am a suite"
|
45
45
|
}),
|
@@ -53,8 +53,8 @@ describe("Suite", function() {
|
|
53
53
|
});
|
54
54
|
|
55
55
|
it("adds after functions in order of needed execution", function() {
|
56
|
-
var env = new
|
57
|
-
suite = new
|
56
|
+
var env = new jasmineUnderTest.Env(),
|
57
|
+
suite = new jasmineUnderTest.Suite({
|
58
58
|
env: env,
|
59
59
|
description: "I am a suite"
|
60
60
|
}),
|
@@ -68,7 +68,7 @@ describe("Suite", function() {
|
|
68
68
|
});
|
69
69
|
|
70
70
|
it('has a status of failed if any afterAll expectations have failed', function() {
|
71
|
-
var suite = new
|
71
|
+
var suite = new jasmineUnderTest.Suite({
|
72
72
|
expectationResultFactory: function() { return 'hi'; }
|
73
73
|
});
|
74
74
|
suite.addChild({ result: { status: 'done' } });
|
@@ -78,27 +78,27 @@ describe("Suite", function() {
|
|
78
78
|
});
|
79
79
|
|
80
80
|
it("retrieves a result with updated status", function() {
|
81
|
-
var suite = new
|
81
|
+
var suite = new jasmineUnderTest.Suite({});
|
82
82
|
|
83
83
|
expect(suite.getResult().status).toBe('finished');
|
84
84
|
});
|
85
85
|
|
86
86
|
it("retrieves a result with disabled status", function() {
|
87
|
-
var suite = new
|
87
|
+
var suite = new jasmineUnderTest.Suite({});
|
88
88
|
suite.disable();
|
89
89
|
|
90
90
|
expect(suite.getResult().status).toBe('disabled');
|
91
91
|
});
|
92
92
|
|
93
93
|
it("retrieves a result with pending status", function() {
|
94
|
-
var suite = new
|
94
|
+
var suite = new jasmineUnderTest.Suite({});
|
95
95
|
suite.pend();
|
96
96
|
|
97
97
|
expect(suite.getResult().status).toBe('pending');
|
98
98
|
});
|
99
99
|
|
100
100
|
it("priviledges a disabled status over pending status", function() {
|
101
|
-
var suite = new
|
101
|
+
var suite = new jasmineUnderTest.Suite({});
|
102
102
|
suite.disable();
|
103
103
|
suite.pend();
|
104
104
|
|
@@ -106,20 +106,20 @@ describe("Suite", function() {
|
|
106
106
|
});
|
107
107
|
|
108
108
|
it("is executable if not disabled", function() {
|
109
|
-
var suite = new
|
109
|
+
var suite = new jasmineUnderTest.Suite({});
|
110
110
|
|
111
111
|
expect(suite.isExecutable()).toBe(true);
|
112
112
|
});
|
113
113
|
|
114
114
|
it("is not executable if disabled", function() {
|
115
|
-
var suite = new
|
115
|
+
var suite = new jasmineUnderTest.Suite({});
|
116
116
|
suite.disable();
|
117
117
|
|
118
118
|
expect(suite.isExecutable()).toBe(false);
|
119
119
|
});
|
120
120
|
|
121
121
|
it("tells all children about expectation failures, even if one throws", function() {
|
122
|
-
var suite = new
|
122
|
+
var suite = new jasmineUnderTest.Suite({}),
|
123
123
|
child1 = { addExpectationResult: jasmine.createSpy('child1#expectationResult'), result: {} },
|
124
124
|
child2 = { addExpectationResult: jasmine.createSpy('child2#expectationResult'), result: {} };
|
125
125
|
|
@@ -135,7 +135,7 @@ describe("Suite", function() {
|
|
135
135
|
});
|
136
136
|
|
137
137
|
it("throws an ExpectationFailed when receiving a failed expectation in an afterAll when throwOnExpectationFailure is set", function() {
|
138
|
-
var suite = new
|
138
|
+
var suite = new jasmineUnderTest.Suite({
|
139
139
|
expectationResultFactory: function(data) { return data; },
|
140
140
|
throwOnExpectationFailure: true
|
141
141
|
});
|
@@ -143,17 +143,17 @@ describe("Suite", function() {
|
|
143
143
|
|
144
144
|
expect(function() {
|
145
145
|
suite.addExpectationResult(false, 'failed');
|
146
|
-
}).toThrowError(
|
146
|
+
}).toThrowError(jasmineUnderTest.errors.ExpectationFailed);
|
147
147
|
|
148
148
|
expect(suite.status()).toBe('failed');
|
149
149
|
expect(suite.result.failedExpectations).toEqual(['failed']);
|
150
150
|
});
|
151
151
|
|
152
152
|
it("does not add an additional failure when an expectation fails in an afterAll", function(){
|
153
|
-
var suite = new
|
153
|
+
var suite = new jasmineUnderTest.Suite({});
|
154
154
|
suite.addChild({ result: { status: 'done' } });
|
155
155
|
|
156
|
-
suite.onException(new
|
156
|
+
suite.onException(new jasmineUnderTest.errors.ExpectationFailed());
|
157
157
|
|
158
158
|
expect(suite.getResult().failedExpectations).toEqual([]);
|
159
159
|
})
|
@@ -1,7 +1,7 @@
|
|
1
1
|
describe("Timer", function() {
|
2
2
|
it("reports the time elapsed", function() {
|
3
3
|
var fakeNow = jasmine.createSpy('fake Date.now'),
|
4
|
-
timer = new
|
4
|
+
timer = new jasmineUnderTest.Timer({now: fakeNow});
|
5
5
|
|
6
6
|
fakeNow.and.returnValue(100);
|
7
7
|
timer.start();
|
@@ -22,7 +22,7 @@ describe("Timer", function() {
|
|
22
22
|
});
|
23
23
|
|
24
24
|
it("does not throw even though Date was taken away", function() {
|
25
|
-
var timer = new
|
25
|
+
var timer = new jasmineUnderTest.Timer();
|
26
26
|
|
27
27
|
expect(timer.start).not.toThrow();
|
28
28
|
expect(timer.elapsed()).toEqual(jasmine.any(Number));
|
@@ -30,7 +30,7 @@ describe("TreeProcessor", function() {
|
|
30
30
|
|
31
31
|
it("processes a single executable leaf", function() {
|
32
32
|
var leaf = new Leaf(),
|
33
|
-
processor = new
|
33
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }),
|
34
34
|
result = processor.processTree();
|
35
35
|
|
36
36
|
expect(result.valid).toBe(true);
|
@@ -43,7 +43,7 @@ describe("TreeProcessor", function() {
|
|
43
43
|
|
44
44
|
it("processes a single non-executable leaf", function() {
|
45
45
|
var leaf = new Leaf({ executable: false }),
|
46
|
-
processor = new
|
46
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [leaf.id] }),
|
47
47
|
result = processor.processTree();
|
48
48
|
|
49
49
|
expect(result.valid).toBe(true);
|
@@ -56,7 +56,7 @@ describe("TreeProcessor", function() {
|
|
56
56
|
|
57
57
|
it("processes a single non-specified leaf", function() {
|
58
58
|
var leaf = new Leaf(),
|
59
|
-
processor = new
|
59
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: leaf, runnableIds: [] }),
|
60
60
|
result = processor.processTree();
|
61
61
|
|
62
62
|
expect(result.valid).toBe(true);
|
@@ -70,7 +70,7 @@ describe("TreeProcessor", function() {
|
|
70
70
|
it("processes a tree with a single leaf with the root specified", function() {
|
71
71
|
var leaf = new Leaf(),
|
72
72
|
parent = new Node({ children: [leaf] }),
|
73
|
-
processor = new
|
73
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: parent, runnableIds: [parent.id] }),
|
74
74
|
result = processor.processTree();
|
75
75
|
|
76
76
|
expect(result.valid).toBe(true);
|
@@ -89,7 +89,7 @@ describe("TreeProcessor", function() {
|
|
89
89
|
it("processes a tree with a single non-executable leaf, with the root specified", function() {
|
90
90
|
var leaf = new Leaf({ executable: false }),
|
91
91
|
parent = new Node({ children: [leaf] }),
|
92
|
-
processor = new
|
92
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: parent, runnableIds: [parent.id] }),
|
93
93
|
result = processor.processTree();
|
94
94
|
|
95
95
|
expect(result.valid).toBe(true);
|
@@ -113,7 +113,7 @@ describe("TreeProcessor", function() {
|
|
113
113
|
childOfDisabled = new Leaf({ executable: true }),
|
114
114
|
disabledNode = new Node({ executable: false, children: [childOfDisabled] }),
|
115
115
|
root = new Node({ children: [parent, childless, disabledNode] }),
|
116
|
-
processor = new
|
116
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id] }),
|
117
117
|
result = processor.processTree();
|
118
118
|
|
119
119
|
expect(result.valid).toBe(true);
|
@@ -160,7 +160,7 @@ describe("TreeProcessor", function() {
|
|
160
160
|
leaf3 = new Leaf(),
|
161
161
|
reentered = new Node({ noReenter: true, children: [leaf1, leaf2] }),
|
162
162
|
root = new Node({ children: [reentered, leaf3] }),
|
163
|
-
processor = new
|
163
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }),
|
164
164
|
result = processor.processTree();
|
165
165
|
|
166
166
|
expect(result).toEqual({ valid: false });
|
@@ -172,7 +172,7 @@ describe("TreeProcessor", function() {
|
|
172
172
|
leaf3 = new Leaf(),
|
173
173
|
reentered = new Node({ children: [leaf1, leaf2] }),
|
174
174
|
root = new Node({ children: [reentered, leaf3] }),
|
175
|
-
processor = new
|
175
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf1.id, leaf3.id, leaf2.id] }),
|
176
176
|
result = processor.processTree();
|
177
177
|
|
178
178
|
expect(result.valid).toBe(true);
|
@@ -184,7 +184,7 @@ describe("TreeProcessor", function() {
|
|
184
184
|
leaf3 = new Leaf(),
|
185
185
|
noReentry = new Node({ noReenter: true }),
|
186
186
|
root = new Node({ children: [noReentry] }),
|
187
|
-
processor = new
|
187
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [leaf2.id, leaf1.id, leaf3.id] }),
|
188
188
|
result = processor.processTree();
|
189
189
|
|
190
190
|
expect(result.valid).toBe(true);
|
@@ -194,7 +194,7 @@ describe("TreeProcessor", function() {
|
|
194
194
|
var leaf1 = new Leaf(),
|
195
195
|
noReentry = new Node({ noReenter: true }),
|
196
196
|
root = new Node({ children: [noReentry] }),
|
197
|
-
processor = new
|
197
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: root, runnableIds: [root.id] }),
|
198
198
|
result = processor.processTree();
|
199
199
|
|
200
200
|
expect(result.valid).toBe(true);
|
@@ -204,7 +204,7 @@ describe("TreeProcessor", function() {
|
|
204
204
|
var leaf = new Leaf(),
|
205
205
|
node = new Node({ children: [leaf], userContext: { root: 'context' } }),
|
206
206
|
queueRunner = jasmine.createSpy('queueRunner'),
|
207
|
-
processor = new
|
207
|
+
processor = new jasmineUnderTest.TreeProcessor({ tree: node, runnableIds: [leaf.id], queueRunnerFactory: queueRunner }),
|
208
208
|
treeComplete = jasmine.createSpy('treeComplete');
|
209
209
|
|
210
210
|
processor.execute(treeComplete);
|
@@ -227,7 +227,7 @@ describe("TreeProcessor", function() {
|
|
227
227
|
nodeStart = jasmine.createSpy('nodeStart'),
|
228
228
|
nodeComplete = jasmine.createSpy('nodeComplete'),
|
229
229
|
queueRunner = jasmine.createSpy('queueRunner'),
|
230
|
-
processor = new
|
230
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
231
231
|
tree: root,
|
232
232
|
runnableIds: [node.id],
|
233
233
|
nodeStart: nodeStart,
|
@@ -269,7 +269,7 @@ describe("TreeProcessor", function() {
|
|
269
269
|
node = new Node({ children: [leaf1, leaf2] }),
|
270
270
|
root = new Node({ children: [node] }),
|
271
271
|
queueRunner = jasmine.createSpy('queueRunner'),
|
272
|
-
processor = new
|
272
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
273
273
|
tree: root,
|
274
274
|
runnableIds: [node.id],
|
275
275
|
queueRunnerFactory: queueRunner
|
@@ -298,7 +298,7 @@ describe("TreeProcessor", function() {
|
|
298
298
|
queueRunner = jasmine.createSpy('queueRunner'),
|
299
299
|
nodeStart = jasmine.createSpy('nodeStart'),
|
300
300
|
nodeComplete = jasmine.createSpy('nodeComplete'),
|
301
|
-
processor = new
|
301
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
302
302
|
tree: root,
|
303
303
|
runnableIds: [node.id],
|
304
304
|
queueRunnerFactory: queueRunner,
|
@@ -334,7 +334,7 @@ describe("TreeProcessor", function() {
|
|
334
334
|
}),
|
335
335
|
root = new Node({ children: [node] }),
|
336
336
|
queueRunner = jasmine.createSpy('queueRunner'),
|
337
|
-
processor = new
|
337
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
338
338
|
tree: root,
|
339
339
|
runnableIds: [node.id],
|
340
340
|
queueRunnerFactory: queueRunner
|
@@ -359,7 +359,7 @@ describe("TreeProcessor", function() {
|
|
359
359
|
}),
|
360
360
|
root = new Node({ children: [node] }),
|
361
361
|
queueRunner = jasmine.createSpy('queueRunner'),
|
362
|
-
processor = new
|
362
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
363
363
|
tree: root,
|
364
364
|
runnableIds: [node.id],
|
365
365
|
queueRunnerFactory: queueRunner
|
@@ -383,7 +383,7 @@ describe("TreeProcessor", function() {
|
|
383
383
|
}),
|
384
384
|
root = new Node({ children: [node] }),
|
385
385
|
queueRunner = jasmine.createSpy('queueRunner'),
|
386
|
-
processor = new
|
386
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
387
387
|
tree: root,
|
388
388
|
runnableIds: [node.id],
|
389
389
|
queueRunnerFactory: queueRunner
|
@@ -410,7 +410,7 @@ describe("TreeProcessor", function() {
|
|
410
410
|
}),
|
411
411
|
root = new Node({ children: [node] }),
|
412
412
|
queueRunner = jasmine.createSpy('queueRunner'),
|
413
|
-
processor = new
|
413
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
414
414
|
tree: root,
|
415
415
|
runnableIds: [node.id],
|
416
416
|
queueRunnerFactory: queueRunner
|
@@ -432,7 +432,7 @@ describe("TreeProcessor", function() {
|
|
432
432
|
leaf2 = new Leaf(),
|
433
433
|
root = new Node({ children: [leaf1, leaf2] }),
|
434
434
|
queueRunner = jasmine.createSpy('queueRunner'),
|
435
|
-
processor = new
|
435
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
436
436
|
tree: root,
|
437
437
|
runnableIds: [leaf2.id, leaf1.id],
|
438
438
|
queueRunnerFactory: queueRunner
|
@@ -456,7 +456,7 @@ describe("TreeProcessor", function() {
|
|
456
456
|
nonSpecified = new Leaf(),
|
457
457
|
root = new Node({ children: [nonSpecified, specified] }),
|
458
458
|
queueRunner = jasmine.createSpy('queueRunner'),
|
459
|
-
processor = new
|
459
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
460
460
|
tree: root,
|
461
461
|
runnableIds: [specified.id],
|
462
462
|
queueRunnerFactory: queueRunner
|
@@ -481,7 +481,7 @@ describe("TreeProcessor", function() {
|
|
481
481
|
specifiedNode = new Node({ children: [childLeaf] }),
|
482
482
|
root = new Node({ children: [specifiedLeaf, specifiedNode] }),
|
483
483
|
queueRunner = jasmine.createSpy('queueRunner'),
|
484
|
-
processor = new
|
484
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
485
485
|
tree: root,
|
486
486
|
runnableIds: [specifiedNode.id, specifiedLeaf.id],
|
487
487
|
queueRunnerFactory: queueRunner
|
@@ -511,7 +511,7 @@ describe("TreeProcessor", function() {
|
|
511
511
|
reentered = new Node({ children: [leaf1, leaf2, leaf3] }),
|
512
512
|
root = new Node({ children: [reentered, leaf4, leaf5] }),
|
513
513
|
queueRunner = jasmine.createSpy('queueRunner'),
|
514
|
-
processor = new
|
514
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
515
515
|
tree: root,
|
516
516
|
runnableIds: [leaf1.id, leaf4.id, leaf2.id, leaf5.id, leaf3.id],
|
517
517
|
queueRunnerFactory: queueRunner
|
@@ -555,7 +555,7 @@ describe("TreeProcessor", function() {
|
|
555
555
|
grandparent = new Node({ children: [parent] }),
|
556
556
|
root = new Node({ children: [grandparent, leaf4, leaf5] }),
|
557
557
|
queueRunner = jasmine.createSpy('queueRunner'),
|
558
|
-
processor = new
|
558
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
559
559
|
tree: root,
|
560
560
|
runnableIds: [leaf1.id, leaf4.id, leaf2.id, leaf5.id, leaf3.id],
|
561
561
|
queueRunnerFactory: queueRunner
|
@@ -609,7 +609,7 @@ describe("TreeProcessor", function() {
|
|
609
609
|
parent = new Node({ children: [leaf2, leaf3] }),
|
610
610
|
root = new Node({ children: [leaf1, parent] }),
|
611
611
|
queueRunner = jasmine.createSpy('queueRunner'),
|
612
|
-
processor = new
|
612
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
613
613
|
tree: root,
|
614
614
|
runnableIds: [root.id],
|
615
615
|
queueRunnerFactory: queueRunner
|
@@ -647,7 +647,7 @@ describe("TreeProcessor", function() {
|
|
647
647
|
leaf11 = new Leaf(),
|
648
648
|
root = new Node({ children: [leaf1, leaf2, leaf3, leaf4, leaf5, leaf6, leaf7, leaf8, leaf9, leaf10, leaf11] }),
|
649
649
|
queueRunner = jasmine.createSpy('queueRunner'),
|
650
|
-
processor = new
|
650
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
651
651
|
tree: root,
|
652
652
|
runnableIds: [root.id],
|
653
653
|
queueRunnerFactory: queueRunner
|
@@ -705,7 +705,7 @@ describe("TreeProcessor", function() {
|
|
705
705
|
leaf11 = new Leaf(),
|
706
706
|
root = new Node({ children: [leaf1, leaf2, leaf3, leaf4, leaf5, leaf6, leaf7, leaf8, leaf9, leaf10, leaf11] }),
|
707
707
|
queueRunner = jasmine.createSpy('queueRunner'),
|
708
|
-
processor = new
|
708
|
+
processor = new jasmineUnderTest.TreeProcessor({
|
709
709
|
tree: root,
|
710
710
|
runnableIds: [root.id],
|
711
711
|
queueRunnerFactory: queueRunner,
|