jasmine-core 2.5.0 → 2.99.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/boot.js +4 -1
- data/lib/jasmine-core/boot.js +5 -2
- data/lib/jasmine-core/jasmine-html.js +95 -31
- data/lib/jasmine-core/jasmine.css +1 -0
- data/lib/jasmine-core/jasmine.js +3635 -1684
- data/lib/jasmine-core/node_boot.js +1 -1
- data/lib/jasmine-core/spec/core/CallTrackerSpec.js +10 -0
- data/lib/jasmine-core/spec/core/ClearStackSpec.js +137 -0
- data/lib/jasmine-core/spec/core/ClockSpec.js +94 -14
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +26 -8
- data/lib/jasmine-core/spec/core/EnvSpec.js +142 -10
- data/lib/jasmine-core/spec/core/ExpectationSpec.js +52 -7
- data/lib/jasmine-core/spec/core/GlobalErrorsSpec.js +110 -0
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +132 -4
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +333 -23
- data/lib/jasmine-core/spec/core/ReportDispatcherSpec.js +16 -1
- data/lib/jasmine-core/spec/core/SpecSpec.js +30 -8
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +225 -1
- data/lib/jasmine-core/spec/core/SpySpec.js +44 -2
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +28 -5
- data/lib/jasmine-core/spec/core/SuiteSpec.js +14 -19
- data/lib/jasmine-core/spec/core/UserContextSpec.js +54 -0
- data/lib/jasmine-core/spec/core/UtilSpec.js +71 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js +32 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js +32 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js +13 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/ArrayWithExactContentsSpec.js +47 -0
- data/lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js +13 -0
- data/lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js +48 -0
- data/lib/jasmine-core/spec/core/integration/EnvSpec.js +339 -38
- data/lib/jasmine-core/spec/core/integration/SpecRunningSpec.js +156 -3
- data/lib/jasmine-core/spec/core/matchers/DiffBuilderSpec.js +47 -0
- data/lib/jasmine-core/spec/core/matchers/NullDiffBuilderSpec.js +13 -0
- data/lib/jasmine-core/spec/core/matchers/ObjectPathSpec.js +43 -0
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +231 -8
- data/lib/jasmine-core/spec/core/matchers/nothingSpec.js +8 -0
- data/lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js +42 -0
- data/lib/jasmine-core/spec/core/matchers/toBeNegativeInfinitySpec.js +31 -0
- data/lib/jasmine-core/spec/core/matchers/toBePositiveInfinitySpec.js +31 -0
- data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +780 -4
- data/lib/jasmine-core/spec/core/matchers/toHaveBeenCalledBeforeSpec.js +99 -0
- data/lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js +37 -0
- data/lib/jasmine-core/spec/helpers/BrowserFlags.js +4 -0
- data/lib/jasmine-core/spec/helpers/asyncAwait.js +27 -0
- data/lib/jasmine-core/spec/helpers/checkForMap.js +37 -0
- data/lib/jasmine-core/spec/helpers/checkForSet.js +41 -0
- data/lib/jasmine-core/spec/helpers/checkForSymbol.js +28 -0
- data/lib/jasmine-core/spec/helpers/checkForTypedArrays.js +20 -0
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +105 -23
- data/lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js +34 -0
- data/lib/jasmine-core/spec/npmPackage/npmPackageSpec.js +1 -1
- data/lib/jasmine-core/version.rb +1 -1
- metadata +19 -4
@@ -0,0 +1,99 @@
|
|
1
|
+
describe("toHaveBeenCalledBefore", function() {
|
2
|
+
it("throws an exception when the actual is not a spy", function() {
|
3
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
4
|
+
fn = function() {},
|
5
|
+
secondSpy = jasmineUnderTest.createSpy('second spy');
|
6
|
+
|
7
|
+
expect(function() { matcher.compare(fn, secondSpy) }).toThrowError(Error, /Expected a spy, but got Function./);
|
8
|
+
});
|
9
|
+
|
10
|
+
it("throws an exception when the expected is not a spy", function() {
|
11
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
12
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
13
|
+
fn = function() {};
|
14
|
+
|
15
|
+
expect(function() { matcher.compare(firstSpy, fn) }).toThrowError(Error, /Expected a spy, but got Function./);
|
16
|
+
});
|
17
|
+
|
18
|
+
it("fails when the actual was not called", function() {
|
19
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
20
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
21
|
+
secondSpy = jasmineUnderTest.createSpy('second spy');
|
22
|
+
|
23
|
+
secondSpy();
|
24
|
+
|
25
|
+
result = matcher.compare(firstSpy, secondSpy);
|
26
|
+
expect(result.pass).toBe(false);
|
27
|
+
expect(result.message).toMatch(/Expected spy first spy to have been called./);
|
28
|
+
});
|
29
|
+
|
30
|
+
it("fails when the expected was not called", function() {
|
31
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
32
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
33
|
+
secondSpy = jasmineUnderTest.createSpy('second spy');
|
34
|
+
|
35
|
+
firstSpy();
|
36
|
+
|
37
|
+
result = matcher.compare(firstSpy, secondSpy);
|
38
|
+
expect(result.pass).toBe(false);
|
39
|
+
expect(result.message).toMatch(/Expected spy second spy to have been called./);
|
40
|
+
});
|
41
|
+
|
42
|
+
it("fails when the actual is called after the expected", function() {
|
43
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
44
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
45
|
+
secondSpy = jasmineUnderTest.createSpy('second spy'),
|
46
|
+
result;
|
47
|
+
|
48
|
+
secondSpy();
|
49
|
+
firstSpy();
|
50
|
+
|
51
|
+
result = matcher.compare(firstSpy, secondSpy);
|
52
|
+
expect(result.pass).toBe(false);
|
53
|
+
expect(result.message).toEqual('Expected spy first spy to have been called before spy second spy');
|
54
|
+
});
|
55
|
+
|
56
|
+
it("fails when the actual is called before and after the expected", function() {
|
57
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
58
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
59
|
+
secondSpy = jasmineUnderTest.createSpy('second spy'),
|
60
|
+
result;
|
61
|
+
|
62
|
+
firstSpy();
|
63
|
+
secondSpy();
|
64
|
+
firstSpy();
|
65
|
+
|
66
|
+
result = matcher.compare(firstSpy, secondSpy);
|
67
|
+
expect(result.pass).toBe(false);
|
68
|
+
expect(result.message).toEqual('Expected latest call to spy first spy to have been called before first call to spy second spy (no interleaved calls)');
|
69
|
+
});
|
70
|
+
|
71
|
+
it("fails when the expected is called before and after the actual", function() {
|
72
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
73
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
74
|
+
secondSpy = jasmineUnderTest.createSpy('second spy'),
|
75
|
+
result;
|
76
|
+
|
77
|
+
secondSpy();
|
78
|
+
firstSpy();
|
79
|
+
secondSpy();
|
80
|
+
|
81
|
+
result = matcher.compare(firstSpy, secondSpy);
|
82
|
+
expect(result.pass).toBe(false);
|
83
|
+
expect(result.message).toEqual('Expected first call to spy second spy to have been called after latest call to spy first spy (no interleaved calls)');
|
84
|
+
});
|
85
|
+
|
86
|
+
it("passes when the actual is called before the expected", function() {
|
87
|
+
var matcher = jasmineUnderTest.matchers.toHaveBeenCalledBefore(),
|
88
|
+
firstSpy = jasmineUnderTest.createSpy('first spy'),
|
89
|
+
secondSpy = jasmineUnderTest.createSpy('second spy'),
|
90
|
+
result;
|
91
|
+
|
92
|
+
firstSpy();
|
93
|
+
secondSpy();
|
94
|
+
|
95
|
+
result = matcher.compare(firstSpy, secondSpy);
|
96
|
+
expect(result.pass).toBe(true);
|
97
|
+
expect(result.message).toEqual('Expected spy first spy to not have been called before spy second spy, but it was');
|
98
|
+
});
|
99
|
+
});
|
@@ -65,6 +65,43 @@ describe("toThrowError", function() {
|
|
65
65
|
expect(result.message()).toEqual("Expected function to throw an Error, but it threw 4.");
|
66
66
|
});
|
67
67
|
|
68
|
+
describe("when error is from another frame", function() {
|
69
|
+
function isNotRunningInBrowser() {
|
70
|
+
return typeof document === 'undefined'
|
71
|
+
}
|
72
|
+
|
73
|
+
var iframe = null;
|
74
|
+
|
75
|
+
afterEach(function() {
|
76
|
+
if (iframe !== null) {
|
77
|
+
document.body.removeChild(iframe);
|
78
|
+
}
|
79
|
+
});
|
80
|
+
|
81
|
+
it("passes if thrown is an instanceof Error regardless of global that contains its constructor", function() {
|
82
|
+
if (isNotRunningInBrowser() || jasmine.getEnv().phantomVersion < 2 || jasmine.getEnv().ieVersion < 10) {
|
83
|
+
return;
|
84
|
+
}
|
85
|
+
|
86
|
+
var matcher = jasmineUnderTest.matchers.toThrowError();
|
87
|
+
iframe = document.body.appendChild(document.createElement("iframe"));
|
88
|
+
iframe.src = "about:blank";
|
89
|
+
var iframeDocument = iframe.contentWindow.document;
|
90
|
+
|
91
|
+
if (iframeDocument.body) {
|
92
|
+
iframeDocument.body.appendChild(iframeDocument.createElement("script"))
|
93
|
+
.textContent = "function method() { throw new Error('foo'); }";
|
94
|
+
} else {
|
95
|
+
// older IE
|
96
|
+
iframeDocument.write("<html><head><script>function method() { throw new Error('foo'); }</script></head></html>");
|
97
|
+
}
|
98
|
+
|
99
|
+
var result = matcher.compare(iframe.contentWindow.method);
|
100
|
+
expect(result.pass).toBe(true);
|
101
|
+
expect(result.message).toEqual("Expected function not to throw an Error, but it threw Error.");
|
102
|
+
});
|
103
|
+
});
|
104
|
+
|
68
105
|
it("fails with the correct message if thrown is a falsy value", function() {
|
69
106
|
var matcher = jasmineUnderTest.matchers.toThrowError(),
|
70
107
|
fn = function() {
|
@@ -0,0 +1,27 @@
|
|
1
|
+
(function(env) {
|
2
|
+
function getAsyncCtor() {
|
3
|
+
try {
|
4
|
+
eval("var func = async function(){};");
|
5
|
+
} catch (e) {
|
6
|
+
return null;
|
7
|
+
}
|
8
|
+
|
9
|
+
return Object.getPrototypeOf(func).constructor;
|
10
|
+
}
|
11
|
+
|
12
|
+
function hasAsyncAwaitSupport() {
|
13
|
+
return getAsyncCtor() !== null;
|
14
|
+
}
|
15
|
+
|
16
|
+
env.makeAsyncAwaitFunction = function() {
|
17
|
+
var AsyncFunction = getAsyncCtor();
|
18
|
+
return new AsyncFunction("");
|
19
|
+
};
|
20
|
+
|
21
|
+
env.requireAsyncAwait = function() {
|
22
|
+
if (!hasAsyncAwaitSupport()) {
|
23
|
+
env.pending("Environment does not support async/await functions");
|
24
|
+
}
|
25
|
+
};
|
26
|
+
})(jasmine.getEnv());
|
27
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
(function(env) {
|
2
|
+
function hasFunctioningMaps() {
|
3
|
+
if (typeof Map === 'undefined') { return false; }
|
4
|
+
|
5
|
+
try {
|
6
|
+
var s = new Map();
|
7
|
+
s.set('a',1);
|
8
|
+
s.set('b',2);
|
9
|
+
|
10
|
+
if (s.size !== 2) { return false; }
|
11
|
+
if (s.has('a') !== true) { return false; }
|
12
|
+
|
13
|
+
var iterations = 0;
|
14
|
+
var ifForEachWorking = true;
|
15
|
+
s.forEach(function(value, key, map) {
|
16
|
+
ifForEachWorking = ifForEachWorking && map === s;
|
17
|
+
if (key==='a') {
|
18
|
+
ifForEachWorking = ifForEachWorking && value===1;
|
19
|
+
}
|
20
|
+
iterations++;
|
21
|
+
});
|
22
|
+
if (iterations !== 2) { return false; }
|
23
|
+
if (ifForEachWorking !== true) { return false; }
|
24
|
+
|
25
|
+
return true;
|
26
|
+
} catch(e) {
|
27
|
+
return false;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
env.requireFunctioningMaps = function() {
|
32
|
+
if (!hasFunctioningMaps()) {
|
33
|
+
env.pending("Browser has incomplete or missing support for Maps");
|
34
|
+
}
|
35
|
+
};
|
36
|
+
|
37
|
+
})(jasmine.getEnv());
|
@@ -0,0 +1,41 @@
|
|
1
|
+
(function(env) {
|
2
|
+
function hasFunctioningSets() {
|
3
|
+
if (typeof Set === 'undefined') { return false; }
|
4
|
+
|
5
|
+
try {
|
6
|
+
var s = new Set();
|
7
|
+
s.add(1);
|
8
|
+
s.add(2);
|
9
|
+
|
10
|
+
if (s.size !== 2) { return false; }
|
11
|
+
if (s.has(1) !== true) { return false; }
|
12
|
+
|
13
|
+
var iterations = 0;
|
14
|
+
var isForEachWorking = true;
|
15
|
+
s.forEach(function(value, key, set) {
|
16
|
+
isForEachWorking = isForEachWorking && set === s;
|
17
|
+
|
18
|
+
if (iterations===0) {
|
19
|
+
isForEachWorking = isForEachWorking && (key===value) && value===1;
|
20
|
+
} else if (iterations===1) {
|
21
|
+
isForEachWorking = isForEachWorking && (key===value) && value===2;
|
22
|
+
}
|
23
|
+
|
24
|
+
iterations++;
|
25
|
+
});
|
26
|
+
if (iterations !== 2) { return false; }
|
27
|
+
if (isForEachWorking !== true) { return false; }
|
28
|
+
|
29
|
+
return true;
|
30
|
+
} catch(e) {
|
31
|
+
return false;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
env.requireFunctioningSets = function() {
|
36
|
+
if (!hasFunctioningSets()) {
|
37
|
+
env.pending("Browser has incomplete or missing support for Sets");
|
38
|
+
}
|
39
|
+
};
|
40
|
+
|
41
|
+
})(jasmine.getEnv());
|
@@ -0,0 +1,28 @@
|
|
1
|
+
(function(env) {
|
2
|
+
function hasFunctioningSymbols() {
|
3
|
+
if (typeof Symbol === 'undefined') {
|
4
|
+
return false;
|
5
|
+
}
|
6
|
+
|
7
|
+
try {
|
8
|
+
var s1 = Symbol();
|
9
|
+
var s2 = Symbol();
|
10
|
+
if (typeof s1 !== 'symbol') {
|
11
|
+
return false;
|
12
|
+
}
|
13
|
+
if (s1 === s2) {
|
14
|
+
return false;
|
15
|
+
}
|
16
|
+
return true;
|
17
|
+
} catch (e) {
|
18
|
+
return false;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
|
22
|
+
env.requireFunctioningSymbols = function() {
|
23
|
+
if (!hasFunctioningSymbols()) {
|
24
|
+
env.pending("Browser has incomplete or missing support for Symbols");
|
25
|
+
}
|
26
|
+
};
|
27
|
+
|
28
|
+
})(jasmine.getEnv());
|
@@ -0,0 +1,20 @@
|
|
1
|
+
(function(env) {
|
2
|
+
function hasFunctioningTypedArrays() {
|
3
|
+
if (typeof Uint32Array === 'undefined') { return false; }
|
4
|
+
|
5
|
+
try {
|
6
|
+
var a = new Uint32Array([1, 2, 3]);
|
7
|
+
if (a.length !== 3) { return false; }
|
8
|
+
return true;
|
9
|
+
} catch(e) {
|
10
|
+
return false;
|
11
|
+
}
|
12
|
+
}
|
13
|
+
|
14
|
+
env.requireFunctioningTypedArrays = function() {
|
15
|
+
if (!hasFunctioningTypedArrays()) {
|
16
|
+
env.pending("Browser has incomplete or missing support for typed arrays");
|
17
|
+
}
|
18
|
+
};
|
19
|
+
|
20
|
+
})(jasmine.getEnv());
|
@@ -208,8 +208,49 @@ describe("New HtmlReporter", function() {
|
|
208
208
|
});
|
209
209
|
});
|
210
210
|
|
211
|
+
describe('when there are deprecation warnings', function() {
|
212
|
+
it('displays the messages in their own alert bars', function() {
|
213
|
+
var env = new jasmineUnderTest.Env(),
|
214
|
+
container = document.createElement('div'),
|
215
|
+
getContainer = function() { return container; },
|
216
|
+
reporter = new jasmineUnderTest.HtmlReporter({
|
217
|
+
env: env,
|
218
|
+
getContainer: getContainer,
|
219
|
+
createElement: function() { return document.createElement.apply(document, arguments); },
|
220
|
+
createTextNode: function() { return document.createTextNode.apply(document, arguments); }
|
221
|
+
});
|
222
|
+
|
223
|
+
reporter.initialize();
|
224
|
+
|
225
|
+
reporter.jasmineStarted({});
|
226
|
+
reporter.specDone({
|
227
|
+
status: 'passed',
|
228
|
+
deprecationWarnings: [{ message: 'spec deprecation' }],
|
229
|
+
failedExpectations: [],
|
230
|
+
passedExpectations: []
|
231
|
+
});
|
232
|
+
reporter.suiteDone({
|
233
|
+
status: 'passed',
|
234
|
+
deprecationWarnings: [{ message: 'suite deprecation' }],
|
235
|
+
failedExpectations: []
|
236
|
+
});
|
237
|
+
reporter.jasmineDone({
|
238
|
+
deprecationWarnings: [{ message: 'global deprecation' }],
|
239
|
+
failedExpectations: []
|
240
|
+
});
|
241
|
+
|
242
|
+
var alertBars = container.querySelectorAll(".jasmine-alert .jasmine-bar");
|
243
|
+
|
244
|
+
expect(alertBars.length).toEqual(4);
|
245
|
+
expect(alertBars[1].innerHTML).toMatch(/spec deprecation/);
|
246
|
+
expect(alertBars[1].getAttribute("class")).toEqual('jasmine-bar jasmine-warning');
|
247
|
+
expect(alertBars[2].innerHTML).toMatch(/suite deprecation/);
|
248
|
+
expect(alertBars[3].innerHTML).toMatch(/global deprecation/);
|
249
|
+
});
|
250
|
+
});
|
251
|
+
|
211
252
|
describe("when Jasmine is done", function() {
|
212
|
-
it("adds
|
253
|
+
it("adds a warning to the link title of specs that have no expectations", function() {
|
213
254
|
if (!window.console) {
|
214
255
|
window.console = { error: function(){} };
|
215
256
|
}
|
@@ -228,7 +269,7 @@ describe("New HtmlReporter", function() {
|
|
228
269
|
reporter.initialize();
|
229
270
|
reporter.jasmineStarted({});
|
230
271
|
reporter.suiteStarted({id: 1});
|
231
|
-
reporter.specStarted({id: 1,
|
272
|
+
reporter.specStarted({id: 1, passedExpectations: [], failedExpectations: []});
|
232
273
|
reporter.specDone({
|
233
274
|
id: 1,
|
234
275
|
status: 'passed',
|
@@ -691,14 +732,15 @@ describe("New HtmlReporter", function() {
|
|
691
732
|
expect(seedBar).toBeNull();
|
692
733
|
});
|
693
734
|
|
694
|
-
it("should include
|
735
|
+
it("should include non-spec query params in the jasmine-skipped link when present", function(){
|
695
736
|
var env = new jasmineUnderTest.Env(),
|
696
737
|
container = document.createElement("div"),
|
697
738
|
reporter = new jasmineUnderTest.HtmlReporter({
|
698
739
|
env: env,
|
699
740
|
getContainer: function() { return container; },
|
700
741
|
createElement: function() { return document.createElement.apply(document, arguments); },
|
701
|
-
createTextNode: function() { return document.createTextNode.apply(document, arguments); }
|
742
|
+
createTextNode: function() { return document.createTextNode.apply(document, arguments); },
|
743
|
+
addToExistingQueryString: function(key, value) { return "?foo=bar&" + key + "=" + value; }
|
702
744
|
});
|
703
745
|
|
704
746
|
reporter.initialize();
|
@@ -706,25 +748,7 @@ describe("New HtmlReporter", function() {
|
|
706
748
|
reporter.jasmineDone({ order: { random: true } });
|
707
749
|
|
708
750
|
var skippedLink = container.querySelector(".jasmine-skipped a");
|
709
|
-
expect(skippedLink.getAttribute('href')).toEqual('?
|
710
|
-
});
|
711
|
-
|
712
|
-
it("should not include the random query param in the jasmine-skipped link when not randomizing", function(){
|
713
|
-
var env = new jasmineUnderTest.Env(),
|
714
|
-
container = document.createElement("div"),
|
715
|
-
reporter = new jasmineUnderTest.HtmlReporter({
|
716
|
-
env: env,
|
717
|
-
getContainer: function() { return container; },
|
718
|
-
createElement: function() { return document.createElement.apply(document, arguments); },
|
719
|
-
createTextNode: function() { return document.createTextNode.apply(document, arguments); }
|
720
|
-
});
|
721
|
-
|
722
|
-
reporter.initialize();
|
723
|
-
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
724
|
-
reporter.jasmineDone();
|
725
|
-
|
726
|
-
var skippedLink = container.querySelector(".jasmine-skipped a");
|
727
|
-
expect(skippedLink.getAttribute('href')).toEqual('?');
|
751
|
+
expect(skippedLink.getAttribute('href')).toEqual('?foo=bar&spec=');
|
728
752
|
});
|
729
753
|
});
|
730
754
|
|
@@ -804,6 +828,64 @@ describe("New HtmlReporter", function() {
|
|
804
828
|
});
|
805
829
|
});
|
806
830
|
|
831
|
+
describe("and there are disabled specs", function() {
|
832
|
+
var env, container, reporter, reporterConfig, specStatus;
|
833
|
+
beforeEach(function() {
|
834
|
+
env = new jasmineUnderTest.Env();
|
835
|
+
container = document.createElement("div");
|
836
|
+
reporterConfig = {
|
837
|
+
env: env,
|
838
|
+
getContainer: function() { return container; },
|
839
|
+
createElement: function() { return document.createElement.apply(document, arguments); },
|
840
|
+
createTextNode: function() { return document.createTextNode.apply(document, arguments); }
|
841
|
+
};
|
842
|
+
specStatus = {
|
843
|
+
id: 123,
|
844
|
+
description: "with a disabled spec",
|
845
|
+
fullName: "A Suite with a disabled spec",
|
846
|
+
status: "disabled",
|
847
|
+
passedExpectations: [],
|
848
|
+
failedExpectations: []
|
849
|
+
};
|
850
|
+
});
|
851
|
+
|
852
|
+
describe("when the specs are not filtered", function() {
|
853
|
+
beforeEach(function() {
|
854
|
+
reporterConfig.filterSpecs = false;
|
855
|
+
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
856
|
+
reporter.initialize();
|
857
|
+
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
858
|
+
reporter.specStarted(specStatus);
|
859
|
+
reporter.specDone(specStatus);
|
860
|
+
reporter.jasmineDone({});
|
861
|
+
});
|
862
|
+
|
863
|
+
it("shows the disabled spec in the spec list", function() {
|
864
|
+
var specList = container.querySelector(".jasmine-summary");
|
865
|
+
|
866
|
+
expect(specList.innerHTML).toContain('with a disabled spec');
|
867
|
+
});
|
868
|
+
});
|
869
|
+
|
870
|
+
describe("when the specs are filtered", function() {
|
871
|
+
beforeEach(function() {
|
872
|
+
reporterConfig.filterSpecs = true;
|
873
|
+
reporter = new jasmineUnderTest.HtmlReporter(reporterConfig);
|
874
|
+
reporter.initialize();
|
875
|
+
reporter.jasmineStarted({ totalSpecsDefined: 1 });
|
876
|
+
reporter.specStarted(specStatus);
|
877
|
+
reporter.specDone(specStatus);
|
878
|
+
reporter.jasmineDone({});
|
879
|
+
});
|
880
|
+
|
881
|
+
it("doesn't show the disabled spec in the spec list", function() {
|
882
|
+
var specList = container.querySelector(".jasmine-summary");
|
883
|
+
|
884
|
+
expect(specList.innerHTML).toEqual('');
|
885
|
+
});
|
886
|
+
});
|
887
|
+
});
|
888
|
+
|
807
889
|
describe("and there are pending specs", function() {
|
808
890
|
var env, container, reporter;
|
809
891
|
beforeEach(function() {
|
@@ -0,0 +1,34 @@
|
|
1
|
+
describe('Spy Registry browser-specific behavior', function() {
|
2
|
+
it('can spy on and unspy window.onerror', function() {
|
3
|
+
requireWriteableOnerror();
|
4
|
+
|
5
|
+
var spies = [],
|
6
|
+
spyRegistry = new jasmineUnderTest.SpyRegistry({
|
7
|
+
currentSpies: function() { return spies; },
|
8
|
+
global: window
|
9
|
+
}),
|
10
|
+
originalHandler = window.onerror;
|
11
|
+
|
12
|
+
try {
|
13
|
+
spyRegistry.spyOn(window, 'onerror');
|
14
|
+
spyRegistry.clearSpies();
|
15
|
+
expect(window.onerror).toBe(originalHandler);
|
16
|
+
} finally {
|
17
|
+
window.onerror = originalHandler;
|
18
|
+
}
|
19
|
+
});
|
20
|
+
|
21
|
+
function requireWriteableOnerror() {
|
22
|
+
var descriptor;
|
23
|
+
|
24
|
+
try {
|
25
|
+
descriptor = Object.getOwnPropertyDescriptor(window, 'onerror');
|
26
|
+
} catch(e) {
|
27
|
+
// IE 8 doesn't support `definePropery` on non-DOM nodes
|
28
|
+
}
|
29
|
+
|
30
|
+
if (descriptor && !(descriptor.writable || descriptor.set)) {
|
31
|
+
pending('Browser declares window.onerror to be readonly');
|
32
|
+
}
|
33
|
+
}
|
34
|
+
});
|
data/lib/jasmine-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jasmine-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.99.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
- Rajan Agaskar
|
8
|
-
- Davis W. Frank
|
9
7
|
- Gregg Van Hove
|
10
8
|
autorequire:
|
11
9
|
bindir: bin
|
12
10
|
cert_chain: []
|
13
|
-
date:
|
11
|
+
date: 2018-02-06 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
14
|
name: rake
|
@@ -98,6 +96,7 @@ files:
|
|
98
96
|
- "./lib/jasmine-core/node_boot.js"
|
99
97
|
- "./lib/jasmine-core/spec/console/ConsoleReporterSpec.js"
|
100
98
|
- "./lib/jasmine-core/spec/core/CallTrackerSpec.js"
|
99
|
+
- "./lib/jasmine-core/spec/core/ClearStackSpec.js"
|
101
100
|
- "./lib/jasmine-core/spec/core/ClockSpec.js"
|
102
101
|
- "./lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js"
|
103
102
|
- "./lib/jasmine-core/spec/core/EnvSpec.js"
|
@@ -105,6 +104,7 @@ files:
|
|
105
104
|
- "./lib/jasmine-core/spec/core/ExceptionsSpec.js"
|
106
105
|
- "./lib/jasmine-core/spec/core/ExpectationResultSpec.js"
|
107
106
|
- "./lib/jasmine-core/spec/core/ExpectationSpec.js"
|
107
|
+
- "./lib/jasmine-core/spec/core/GlobalErrorsSpec.js"
|
108
108
|
- "./lib/jasmine-core/spec/core/JsApiReporterSpec.js"
|
109
109
|
- "./lib/jasmine-core/spec/core/MockDateSpec.js"
|
110
110
|
- "./lib/jasmine-core/spec/core/PrettyPrintSpec.js"
|
@@ -117,17 +117,23 @@ files:
|
|
117
117
|
- "./lib/jasmine-core/spec/core/SuiteSpec.js"
|
118
118
|
- "./lib/jasmine-core/spec/core/TimerSpec.js"
|
119
119
|
- "./lib/jasmine-core/spec/core/TreeProcessorSpec.js"
|
120
|
+
- "./lib/jasmine-core/spec/core/UserContextSpec.js"
|
120
121
|
- "./lib/jasmine-core/spec/core/UtilSpec.js"
|
121
122
|
- "./lib/jasmine-core/spec/core/asymmetric_equality/AnySpec.js"
|
122
123
|
- "./lib/jasmine-core/spec/core/asymmetric_equality/AnythingSpec.js"
|
123
124
|
- "./lib/jasmine-core/spec/core/asymmetric_equality/ArrayContainingSpec.js"
|
125
|
+
- "./lib/jasmine-core/spec/core/asymmetric_equality/ArrayWithExactContentsSpec.js"
|
124
126
|
- "./lib/jasmine-core/spec/core/asymmetric_equality/ObjectContainingSpec.js"
|
125
127
|
- "./lib/jasmine-core/spec/core/asymmetric_equality/StringMatchingSpec.js"
|
126
128
|
- "./lib/jasmine-core/spec/core/formatErrorMsgSpec.js"
|
127
129
|
- "./lib/jasmine-core/spec/core/integration/CustomMatchersSpec.js"
|
128
130
|
- "./lib/jasmine-core/spec/core/integration/EnvSpec.js"
|
129
131
|
- "./lib/jasmine-core/spec/core/integration/SpecRunningSpec.js"
|
132
|
+
- "./lib/jasmine-core/spec/core/matchers/DiffBuilderSpec.js"
|
133
|
+
- "./lib/jasmine-core/spec/core/matchers/NullDiffBuilderSpec.js"
|
134
|
+
- "./lib/jasmine-core/spec/core/matchers/ObjectPathSpec.js"
|
130
135
|
- "./lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js"
|
136
|
+
- "./lib/jasmine-core/spec/core/matchers/nothingSpec.js"
|
131
137
|
- "./lib/jasmine-core/spec/core/matchers/toBeCloseToSpec.js"
|
132
138
|
- "./lib/jasmine-core/spec/core/matchers/toBeDefinedSpec.js"
|
133
139
|
- "./lib/jasmine-core/spec/core/matchers/toBeFalsySpec.js"
|
@@ -136,12 +142,15 @@ files:
|
|
136
142
|
- "./lib/jasmine-core/spec/core/matchers/toBeLessThanOrEqualSpec.js"
|
137
143
|
- "./lib/jasmine-core/spec/core/matchers/toBeLessThanSpec.js"
|
138
144
|
- "./lib/jasmine-core/spec/core/matchers/toBeNaNSpec.js"
|
145
|
+
- "./lib/jasmine-core/spec/core/matchers/toBeNegativeInfinitySpec.js"
|
139
146
|
- "./lib/jasmine-core/spec/core/matchers/toBeNullSpec.js"
|
147
|
+
- "./lib/jasmine-core/spec/core/matchers/toBePositiveInfinitySpec.js"
|
140
148
|
- "./lib/jasmine-core/spec/core/matchers/toBeSpec.js"
|
141
149
|
- "./lib/jasmine-core/spec/core/matchers/toBeTruthySpec.js"
|
142
150
|
- "./lib/jasmine-core/spec/core/matchers/toBeUndefinedSpec.js"
|
143
151
|
- "./lib/jasmine-core/spec/core/matchers/toContainSpec.js"
|
144
152
|
- "./lib/jasmine-core/spec/core/matchers/toEqualSpec.js"
|
153
|
+
- "./lib/jasmine-core/spec/core/matchers/toHaveBeenCalledBeforeSpec.js"
|
145
154
|
- "./lib/jasmine-core/spec/core/matchers/toHaveBeenCalledSpec.js"
|
146
155
|
- "./lib/jasmine-core/spec/core/matchers/toHaveBeenCalledTimesSpec.js"
|
147
156
|
- "./lib/jasmine-core/spec/core/matchers/toHaveBeenCalledWithSpec.js"
|
@@ -149,6 +158,11 @@ files:
|
|
149
158
|
- "./lib/jasmine-core/spec/core/matchers/toThrowErrorSpec.js"
|
150
159
|
- "./lib/jasmine-core/spec/core/matchers/toThrowSpec.js"
|
151
160
|
- "./lib/jasmine-core/spec/helpers/BrowserFlags.js"
|
161
|
+
- "./lib/jasmine-core/spec/helpers/asyncAwait.js"
|
162
|
+
- "./lib/jasmine-core/spec/helpers/checkForMap.js"
|
163
|
+
- "./lib/jasmine-core/spec/helpers/checkForSet.js"
|
164
|
+
- "./lib/jasmine-core/spec/helpers/checkForSymbol.js"
|
165
|
+
- "./lib/jasmine-core/spec/helpers/checkForTypedArrays.js"
|
152
166
|
- "./lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js"
|
153
167
|
- "./lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js"
|
154
168
|
- "./lib/jasmine-core/spec/html/HtmlReporterSpec.js"
|
@@ -157,6 +171,7 @@ files:
|
|
157
171
|
- "./lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js"
|
158
172
|
- "./lib/jasmine-core/spec/html/QueryStringSpec.js"
|
159
173
|
- "./lib/jasmine-core/spec/html/ResultsNodeSpec.js"
|
174
|
+
- "./lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js"
|
160
175
|
- "./lib/jasmine-core/spec/npmPackage/npmPackageSpec.js"
|
161
176
|
- "./lib/jasmine-core/spec/performance/large_object_test.js"
|
162
177
|
- "./lib/jasmine-core/spec/performance/performance_test.js"
|