jasmine-core 2.8.0 → 2.9.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.
@@ -3,10 +3,25 @@
3
3
  if (typeof Map === 'undefined') { return false; }
4
4
 
5
5
  try {
6
- var s = new Map([['a', 4]]);
7
- if (s.size !== 1) { return false; }
8
- if (s.keys().next().value !== 'a') { return false; }
9
- if (s.values().next().value !== 4) { return false; }
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([4]);
7
- if (s.size !== 1) { return false; }
8
- if (s.values().next().value !== 4) { return false; }
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 EMPTY to the link title of specs that have no expectations", function() {
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, status: 'passed', passedExpectations: [], failedExpectations: []});
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
+ });
@@ -4,6 +4,6 @@
4
4
  #
5
5
  module Jasmine
6
6
  module Core
7
- VERSION = "2.8.0"
7
+ VERSION = "2.9.0"
8
8
  end
9
9
  end
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.8.0
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: 2017-08-24 00:00:00.000000000 Z
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"