jasmine-core 2.9.0 → 2.99.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.
- checksums.yaml +4 -4
- data/lib/jasmine-core/jasmine-html.js +24 -1
- data/lib/jasmine-core/jasmine.css +1 -0
- data/lib/jasmine-core/jasmine.js +50 -6
- data/lib/jasmine-core/version.rb +1 -1
- metadata +3 -84
- data/lib/jasmine-core/spec/console/ConsoleReporterSpec.js +0 -270
- data/lib/jasmine-core/spec/core/CallTrackerSpec.js +0 -130
- data/lib/jasmine-core/spec/core/ClearStackSpec.js +0 -137
- data/lib/jasmine-core/spec/core/ClockSpec.js +0 -754
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +0 -270
- data/lib/jasmine-core/spec/core/EnvSpec.js +0 -200
- data/lib/jasmine-core/spec/core/ExceptionFormatterSpec.js +0 -63
- data/lib/jasmine-core/spec/core/ExceptionsSpec.js +0 -68
- data/lib/jasmine-core/spec/core/ExpectationResultSpec.js +0 -61
- data/lib/jasmine-core/spec/core/ExpectationSpec.js +0 -434
- data/lib/jasmine-core/spec/core/GlobalErrorsSpec.js +0 -110
- data/lib/jasmine-core/spec/core/JsApiReporterSpec.js +0 -259
- data/lib/jasmine-core/spec/core/MockDateSpec.js +0 -200
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +0 -337
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +0 -620
- data/lib/jasmine-core/spec/core/ReportDispatcherSpec.js +0 -79
- data/lib/jasmine-core/spec/core/SpecSpec.js +0 -441
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +0 -356
- data/lib/jasmine-core/spec/core/SpySpec.js +0 -127
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +0 -159
- data/lib/jasmine-core/spec/core/SuiteSpec.js +0 -155
- data/lib/jasmine-core/spec/core/TimerSpec.js +0 -31
- data/lib/jasmine-core/spec/core/TreeProcessorSpec.js +0 -756
- data/lib/jasmine-core/spec/core/UserContextSpec.js +0 -54
- data/lib/jasmine-core/spec/core/UtilSpec.js +0 -99
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +0 -84
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js +0 -76
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js +0 -52
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayWithExactContentsSpec.js +0 -47
- data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +0 -102
- data/lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js +0 -27
- data/lib/jasmine-core/spec/core/formatErrorMsgSpec.js +0 -13
- data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +0 -199
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +0 -2007
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +0 -950
- data/lib/jasmine-core/spec/core/matchers/DiffBuilderSpec.js +0 -47
- data/lib/jasmine-core/spec/core/matchers/NullDiffBuilderSpec.js +0 -13
- data/lib/jasmine-core/spec/core/matchers/ObjectPathSpec.js +0 -43
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +0 -658
- data/lib/jasmine-core/spec/core/matchers/nothingSpec.js +0 -8
- data/lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js +0 -93
- data/lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js +0 -18
- data/lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js +0 -38
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanOrEqualSpec.js +0 -29
- data/lib/jasmine-core/spec/core/matchers/toBeGreaterThanSpec.js +0 -20
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js +0 -29
- data/lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js +0 -20
- data/lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js +0 -37
- data/lib/jasmine-core/spec/core/matchers/toBeNegativeInfinitySpec.js +0 -31
- data/lib/jasmine-core/spec/core/matchers/toBeNullSpec.js +0 -17
- data/lib/jasmine-core/spec/core/matchers/toBePositiveInfinitySpec.js +0 -31
- data/lib/jasmine-core/spec/core/matchers/toBeSpec.js +0 -17
- data/lib/jasmine-core/spec/core/matchers/toBeTruthySpec.js +0 -38
- data/lib/jasmine-core/spec/core/matchers/toBeUndefinedSpec.js +0 -18
- data/lib/jasmine-core/spec/core/matchers/toContainSpec.js +0 -26
- data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +0 -804
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledBeforeSpec.js +0 -99
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledSpec.js +0 -47
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js +0 -86
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledWithSpec.js +0 -67
- data/lib/jasmine-core/spec/core/matchers/toMatchSpec.js +0 -43
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +0 -315
- data/lib/jasmine-core/spec/core/matchers/toThrowSpec.js +0 -100
- data/lib/jasmine-core/spec/helpers/BrowserFlags.js +0 -27
- data/lib/jasmine-core/spec/helpers/asyncAwait.js +0 -27
- data/lib/jasmine-core/spec/helpers/checkForMap.js +0 -37
- data/lib/jasmine-core/spec/helpers/checkForSet.js +0 -41
- data/lib/jasmine-core/spec/helpers/checkForSymbol.js +0 -28
- data/lib/jasmine-core/spec/helpers/checkForTypedArrays.js +0 -20
- data/lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js +0 -7
- data/lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js +0 -33
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +0 -982
- data/lib/jasmine-core/spec/html/HtmlSpecFilterSpec.js +0 -18
- data/lib/jasmine-core/spec/html/MatchersHtmlSpec.js +0 -37
- data/lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js +0 -15
- data/lib/jasmine-core/spec/html/QueryStringSpec.js +0 -72
- data/lib/jasmine-core/spec/html/ResultsNodeSpec.js +0 -62
- data/lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js +0 -34
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +0 -101
- data/lib/jasmine-core/spec/performance/large_object_test.js +0 -36
- data/lib/jasmine-core/spec/performance/performance_test.js +0 -10
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
describe("Custom Matchers (Integration)", function() {
|
|
2
|
-
var env;
|
|
3
|
-
var fakeTimer;
|
|
4
|
-
|
|
5
|
-
beforeEach(function() {
|
|
6
|
-
env = new jasmineUnderTest.Env();
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
it("allows adding more matchers local to a spec", function(done) {
|
|
10
|
-
env.it('spec defining a custom matcher', function() {
|
|
11
|
-
env.addMatchers({
|
|
12
|
-
matcherForSpec: function() {
|
|
13
|
-
return {
|
|
14
|
-
compare: function(actual, expected) {
|
|
15
|
-
return { pass: false, message: "matcherForSpec: actual: " + actual + "; expected: " + expected };
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
env.expect("zzz").matcherForSpec("yyy");
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
env.it("spec without custom matcher defined", function() {
|
|
25
|
-
expect(env.expect("zzz").matcherForSpec).toBeUndefined();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
var specDoneSpy = jasmine.createSpy("specDoneSpy");
|
|
29
|
-
var expectations = function() {
|
|
30
|
-
var firstSpecResult = specDoneSpy.calls.first().args[0];
|
|
31
|
-
expect(firstSpecResult.status).toEqual("failed");
|
|
32
|
-
expect(firstSpecResult.failedExpectations[0].message).toEqual("matcherForSpec: actual: zzz; expected: yyy");
|
|
33
|
-
done();
|
|
34
|
-
};
|
|
35
|
-
env.addReporter({ specDone:specDoneSpy, jasmineDone: expectations});
|
|
36
|
-
|
|
37
|
-
env.execute();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("passes the spec if the custom matcher passes", function(done) {
|
|
41
|
-
env.it("spec using custom matcher", function() {
|
|
42
|
-
env.addMatchers({
|
|
43
|
-
toBeReal: function() {
|
|
44
|
-
return { compare: function() { return { pass: true }; } };
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
env.expect(true).toBeReal();
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
var specExpectations = function(result) {
|
|
52
|
-
expect(result.status).toEqual('passed');
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
56
|
-
env.execute();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it("passes the spec if the custom equality matcher passes for types nested inside asymmetric equality testers", function(done) {
|
|
60
|
-
env.it("spec using custom equality matcher", function() {
|
|
61
|
-
var customEqualityFn = function(a, b) {
|
|
62
|
-
// All "foo*" strings match each other.
|
|
63
|
-
if (typeof a == "string" && typeof b == "string" &&
|
|
64
|
-
a.substr(0, 3) == "foo" && b.substr(0, 3) == "foo") {
|
|
65
|
-
return true;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
env.addCustomEqualityTester(customEqualityFn);
|
|
70
|
-
env.expect({foo: 'fooValue'}).toEqual(jasmineUnderTest.objectContaining({foo: 'fooBar'}));
|
|
71
|
-
env.expect(['fooValue', 'things']).toEqual(jasmineUnderTest.arrayContaining(['fooBar']));
|
|
72
|
-
env.expect(['fooValue']).toEqual(jasmineUnderTest.arrayWithExactContents(['fooBar']));
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
var specExpectations = function(result) {
|
|
76
|
-
expect(result.status).toEqual('passed');
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
80
|
-
env.execute();
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
it("displays an appropriate failure message if a custom equality matcher fails", function(done) {
|
|
84
|
-
env.it("spec using custom equality matcher", function() {
|
|
85
|
-
var customEqualityFn = function(a, b) {
|
|
86
|
-
// "foo" is not equal to anything
|
|
87
|
-
if (a === 'foo' || b === 'foo') {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
env.addCustomEqualityTester(customEqualityFn);
|
|
93
|
-
env.expect({foo: 'foo'}).toEqual({foo: 'foo'});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
var specExpectations = function(result) {
|
|
97
|
-
expect(result.status).toEqual('failed');
|
|
98
|
-
expect(result.failedExpectations[0].message).toEqual(
|
|
99
|
-
"Expected $.foo = 'foo' to equal 'foo'."
|
|
100
|
-
);
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
104
|
-
env.execute();
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
it("uses the negative compare function for a negative comparison, if provided", function(done) {
|
|
108
|
-
env.it("spec with custom negative comparison matcher", function() {
|
|
109
|
-
env.addMatchers({
|
|
110
|
-
toBeReal: function() {
|
|
111
|
-
return {
|
|
112
|
-
compare: function() { return { pass: true }; },
|
|
113
|
-
negativeCompare: function() { return { pass: true }; }
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
env.expect(true).not.toBeReal();
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
var specExpectations = function(result) {
|
|
122
|
-
expect(result.status).toEqual('passed');
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
126
|
-
env.execute();
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
it("generates messages with the same rules as built in matchers absent a custom message", function(done) {
|
|
130
|
-
env.it('spec with an expectation', function() {
|
|
131
|
-
env.addMatchers({
|
|
132
|
-
toBeReal: function() {
|
|
133
|
-
return {
|
|
134
|
-
compare: function() {
|
|
135
|
-
return { pass: false };
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
env.expect("a").toBeReal();
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
var specExpectations = function(result) {
|
|
145
|
-
expect(result.failedExpectations[0].message).toEqual("Expected 'a' to be real.");
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
149
|
-
env.execute();
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
it("passes the expected and actual arguments to the comparison function", function(done) {
|
|
153
|
-
var argumentSpy = jasmine.createSpy("argument spy").and.returnValue({ pass: true });
|
|
154
|
-
|
|
155
|
-
env.it('spec with an expectation', function () {
|
|
156
|
-
env.addMatchers({
|
|
157
|
-
toBeReal: function() {
|
|
158
|
-
return { compare: argumentSpy };
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
env.expect(true).toBeReal();
|
|
163
|
-
env.expect(true).toBeReal("arg");
|
|
164
|
-
env.expect(true).toBeReal("arg1", "arg2");
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
var specExpectations = function() {
|
|
168
|
-
expect(argumentSpy).toHaveBeenCalledWith(true);
|
|
169
|
-
expect(argumentSpy).toHaveBeenCalledWith(true, "arg");
|
|
170
|
-
expect(argumentSpy).toHaveBeenCalledWith(true, "arg1", "arg2");
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
174
|
-
env.execute();
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it("passes the jasmine utility and current equality matchers to the expectation factory", function(done) {
|
|
178
|
-
var matcherFactory = function() { return { compare: function() { return {pass: true}; }}; },
|
|
179
|
-
argumentSpy = jasmine.createSpy("argument spy").and.returnValue(matcherFactory),
|
|
180
|
-
customEqualityFn = function() { return true; };
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
env.it("spec with expectation", function() {
|
|
184
|
-
env.addCustomEqualityTester(customEqualityFn);
|
|
185
|
-
env.addMatchers({
|
|
186
|
-
toBeReal: argumentSpy
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
env.expect(true).toBeReal();
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
var specExpectations = function() {
|
|
193
|
-
expect(argumentSpy).toHaveBeenCalledWith(jasmineUnderTest.matchersUtil, [customEqualityFn]);
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
env.addReporter({ specDone: specExpectations, jasmineDone: done });
|
|
197
|
-
env.execute();
|
|
198
|
-
});
|
|
199
|
-
});
|