jasmine-core 2.8.0 → 2.9.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +53 -30
- data/lib/jasmine-core/jasmine.js +258 -101
- data/lib/jasmine-core/node_boot.js +1 -1
- data/lib/jasmine-core/spec/core/ClockSpec.js +85 -13
- data/lib/jasmine-core/spec/core/DelayedFunctionSchedulerSpec.js +10 -8
- data/lib/jasmine-core/spec/core/PrettyPrintSpec.js +63 -15
- data/lib/jasmine-core/spec/core/QueueRunnerSpec.js +8 -5
- data/lib/jasmine-core/spec/core/SpyRegistrySpec.js +18 -0
- data/lib/jasmine-core/spec/core/SpyStrategySpec.js +23 -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/integration/EnvSpec.js +101 -0
- data/lib/jasmine-core/spec/core/matchers/matchersUtilSpec.js +130 -44
- data/lib/jasmine-core/spec/core/matchers/toEqualSpec.js +124 -39
- data/lib/jasmine-core/spec/helpers/checkForMap.js +19 -4
- data/lib/jasmine-core/spec/helpers/checkForSet.js +23 -3
- data/lib/jasmine-core/spec/helpers/checkForSymbol.js +28 -0
- data/lib/jasmine-core/spec/html/HtmlReporterSpec.js +2 -2
- data/lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js +34 -0
- data/lib/jasmine-core/version.rb +1 -1
- metadata +4 -2
@@ -3,10 +3,25 @@
|
|
3
3
|
if (typeof Map === 'undefined') { return false; }
|
4
4
|
|
5
5
|
try {
|
6
|
-
var s = new Map(
|
7
|
-
|
8
|
-
|
9
|
-
|
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
|
+
|
10
25
|
return true;
|
11
26
|
} catch(e) {
|
12
27
|
return false;
|
@@ -3,9 +3,29 @@
|
|
3
3
|
if (typeof Set === 'undefined') { return false; }
|
4
4
|
|
5
5
|
try {
|
6
|
-
var s = new Set(
|
7
|
-
|
8
|
-
|
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
|
+
|
9
29
|
return true;
|
10
30
|
} catch(e) {
|
11
31
|
return false;
|
@@ -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());
|
@@ -209,7 +209,7 @@ describe("New HtmlReporter", function() {
|
|
209
209
|
});
|
210
210
|
|
211
211
|
describe("when Jasmine is done", function() {
|
212
|
-
it("adds
|
212
|
+
it("adds a warning to the link title of specs that have no expectations", function() {
|
213
213
|
if (!window.console) {
|
214
214
|
window.console = { error: function(){} };
|
215
215
|
}
|
@@ -228,7 +228,7 @@ describe("New HtmlReporter", function() {
|
|
228
228
|
reporter.initialize();
|
229
229
|
reporter.jasmineStarted({});
|
230
230
|
reporter.suiteStarted({id: 1});
|
231
|
-
reporter.specStarted({id: 1,
|
231
|
+
reporter.specStarted({id: 1, passedExpectations: [], failedExpectations: []});
|
232
232
|
reporter.specDone({
|
233
233
|
id: 1,
|
234
234
|
status: 'passed',
|
@@ -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,14 +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.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Van Hove
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -161,6 +161,7 @@ files:
|
|
161
161
|
- "./lib/jasmine-core/spec/helpers/asyncAwait.js"
|
162
162
|
- "./lib/jasmine-core/spec/helpers/checkForMap.js"
|
163
163
|
- "./lib/jasmine-core/spec/helpers/checkForSet.js"
|
164
|
+
- "./lib/jasmine-core/spec/helpers/checkForSymbol.js"
|
164
165
|
- "./lib/jasmine-core/spec/helpers/checkForTypedArrays.js"
|
165
166
|
- "./lib/jasmine-core/spec/helpers/defineJasmineUnderTest.js"
|
166
167
|
- "./lib/jasmine-core/spec/helpers/nodeDefineJasmineUnderTest.js"
|
@@ -170,6 +171,7 @@ files:
|
|
170
171
|
- "./lib/jasmine-core/spec/html/PrettyPrintHtmlSpec.js"
|
171
172
|
- "./lib/jasmine-core/spec/html/QueryStringSpec.js"
|
172
173
|
- "./lib/jasmine-core/spec/html/ResultsNodeSpec.js"
|
174
|
+
- "./lib/jasmine-core/spec/html/SpyRegistryHtmlSpec.js"
|
173
175
|
- "./lib/jasmine-core/spec/npmPackage/npmPackageSpec.js"
|
174
176
|
- "./lib/jasmine-core/spec/performance/large_object_test.js"
|
175
177
|
- "./lib/jasmine-core/spec/performance/performance_test.js"
|