jasmine-core 2.0.4 → 2.1.3

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.
package/CONTRIBUTING.md CHANGED
@@ -100,7 +100,7 @@ Jasmine uses the [Jasmine Ruby gem](http://github.com/pivotal/jasmine-gem) to te
100
100
 
101
101
  ...and then visit `http://localhost:8888` to run specs.
102
102
 
103
- Jasmine uses Node.js with a custom runner to test outside of a browser.
103
+ Jasmine uses the [Jasmine NPM package](http://github.com/pivotal/jasmine-npm) to test itself in a Node.js/npm environment.
104
104
 
105
105
  $ grunt execSpecsInNode
106
106
 
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  <a name="README">[<img src="https://rawgithub.com/pivotal/jasmine/master/images/jasmine-horizontal.svg" width="400px" />](http://jasmine.github.io)</a>
2
2
 
3
- [![Build Status](https://travis-ci.org/pivotal/jasmine.png?branch=master)](https://travis-ci.org/pivotal/jasmine) [![Code Climate](https://codeclimate.com/github/pivotal/jasmine.png)](https://codeclimate.com/github/pivotal/jasmine)
3
+ [![Build Status](https://travis-ci.org/jasmine/jasmine.png?branch=master)](https://travis-ci.org/jasmine/jasmine) [![Code Climate](https://codeclimate.com/github/pivotal/jasmine.png)](https://codeclimate.com/github/pivotal/jasmine)
4
4
 
5
5
  =======
6
6
 
@@ -53,12 +53,13 @@ For the Jasmine Python Egg:<br>
53
53
 
54
54
  ## Maintainers
55
55
 
56
- * [Davis W. Frank](mailto:dwfrank@pivotallabs.com), Pivotal Labs
57
- * [Rajan Agaskar](mailto:rajan@pivotallabs.com), Pivotal Labs
58
- * [Sheel Choksi](mailto:schoksi@pivotallabs.com), Pivotal Labs
56
+ * [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
57
+ * [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
58
+ * [Gregg Van Hove](mailto:ghove@pivotal.io), Pivotal Labs
59
59
 
60
60
  ### Maintainers Emeritus
61
61
 
62
- * [Christian Williams](mailto:antixian666@gmail.com), Square
62
+ * [Christian Williams](mailto:antixian666@gmail.com), Cloud Foundry
63
+ * Sheel Choksi
63
64
 
64
65
  Copyright (c) 2008-2014 Pivotal Labs. This software is licensed under the MIT License.
package/RELEASE.md CHANGED
@@ -33,7 +33,7 @@ When ready to release - specs are all green and the stories are done:
33
33
 
34
34
  1. Build the standalone distribution with `grunt buildStandaloneDist`
35
35
  1. Make sure you add the new ZIP file to git
36
- 1. Should we still do this? Given we want to use guthub releases...
36
+ 1. Should we still do this? Given we want to use github releases...
37
37
 
38
38
  ### Release the Python egg
39
39
 
@@ -52,6 +52,13 @@ When ready to release - specs are all green and the stories are done:
52
52
  1. `npm adduser` to save your credentials locally
53
53
  1. `npm publish .` to publish what's in `package.json`
54
54
 
55
+ ### Release the docs
56
+
57
+ Probably only need to do this when releasing a minor version, and not a patch version.
58
+
59
+ 1. `cp edge ${version}` to copy the current edge docs to the new version
60
+ 1. Add a link to the new version in `index.html`
61
+
55
62
  ### Finally
56
63
 
57
64
  1. Visit the [Releases page for Jasmine](https://github.com/pivotal/jasmine/releases), find the tag just pushed.
@@ -54,7 +54,10 @@ getJasmineRequireObj().ConsoleReporter = function() {
54
54
  red: '\x1B[31m',
55
55
  yellow: '\x1B[33m',
56
56
  none: '\x1B[0m'
57
- };
57
+ },
58
+ failedSuites = [];
59
+
60
+ print('ConsoleReporter is deprecated and will be removed in a future version.');
58
61
 
59
62
  this.jasmineStarted = function() {
60
63
  specCount = 0;
@@ -89,9 +92,12 @@ getJasmineRequireObj().ConsoleReporter = function() {
89
92
  printNewline();
90
93
  var seconds = timer.elapsed() / 1000;
91
94
  print('Finished in ' + seconds + ' ' + plural('second', seconds));
92
-
93
95
  printNewline();
94
96
 
97
+ for(i = 0; i < failedSuites.length; i++) {
98
+ suiteFailureDetails(failedSuites[i]);
99
+ }
100
+
95
101
  onComplete(failureCount === 0);
96
102
  };
97
103
 
@@ -116,6 +122,13 @@ getJasmineRequireObj().ConsoleReporter = function() {
116
122
  }
117
123
  };
118
124
 
125
+ this.suiteDone = function(result) {
126
+ if (result.failedExpectations && result.failedExpectations.length > 0) {
127
+ failureCount++;
128
+ failedSuites.push(result);
129
+ }
130
+ };
131
+
119
132
  return this;
120
133
 
121
134
  function printNewline() {
@@ -160,6 +173,17 @@ getJasmineRequireObj().ConsoleReporter = function() {
160
173
 
161
174
  printNewline();
162
175
  }
176
+
177
+ function suiteFailureDetails(result) {
178
+ for (var i = 0; i < result.failedExpectations.length; i++) {
179
+ printNewline();
180
+ print(colored('red', 'An error was thrown in an afterAll'));
181
+ printNewline();
182
+ print(colored('red', 'AfterAll ' + result.failedExpectations[i].message));
183
+
184
+ }
185
+ printNewline();
186
+ }
163
187
  }
164
188
 
165
189
  return ConsoleReporter;
@@ -21,7 +21,7 @@ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21
21
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
22
  */
23
23
  /**
24
- Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
24
+ Starting with version 2.0, this file "boots" Jasmine, performing all of the necessary initialization before executing the loaded environment and all of a project's specs. This file should be loaded after `jasmine.js` and `jasmine_html.js`, but before any project source files or spec files are loaded. Thus this file can also be used to customize Jasmine for a project.
25
25
 
26
26
  If a project is using Jasmine via the standalone distribution, this file can be customized directly. If a project is using Jasmine via the [Ruby gem][jasmine-gem], this file can be copied into the support directory via `jasmine copy_boot_js`. Other environments (e.g., Python) will have different mechanisms.
27
27
 
@@ -1,6 +1,6 @@
1
1
  describe("Player", function() {
2
- var Player = require('../../jasmine_examples/Player.js');
3
- var Song = require('../../jasmine_examples/Song.js');
2
+ var Player = require('../src/Player.js');
3
+ var Song = require('../src/Song.js');
4
4
  var player;
5
5
  var song;
6
6
 
@@ -46,7 +46,8 @@ jasmineRequire.HtmlReporter = function(j$) {
46
46
  failureCount = 0,
47
47
  pendingSpecCount = 0,
48
48
  htmlReporterMain,
49
- symbols;
49
+ symbols,
50
+ failedSuites = [];
50
51
 
51
52
  this.initialize = function() {
52
53
  clearPrior();
@@ -83,6 +84,10 @@ jasmineRequire.HtmlReporter = function(j$) {
83
84
  };
84
85
 
85
86
  this.suiteDone = function(result) {
87
+ if (result.status == 'failed') {
88
+ failedSuites.push(result);
89
+ }
90
+
86
91
  if (currentParent == topResults) {
87
92
  return;
88
93
  }
@@ -96,7 +101,7 @@ jasmineRequire.HtmlReporter = function(j$) {
96
101
 
97
102
  var failures = [];
98
103
  this.specDone = function(result) {
99
- if(noExpectations(result) && console && console.error) {
104
+ if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
100
105
  console.error('Spec \'' + result.fullName + '\' has no expectations.');
101
106
  }
102
107
 
@@ -178,6 +183,15 @@ jasmineRequire.HtmlReporter = function(j$) {
178
183
 
179
184
  alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage));
180
185
 
186
+ for(i = 0; i < failedSuites.length; i++) {
187
+ var failedSuite = failedSuites[i];
188
+ for(var j = 0; j < failedSuite.failedExpectations.length; j++) {
189
+ var errorBarMessage = 'AfterAll ' + failedSuite.failedExpectations[j].message;
190
+ var errorBarClassName = 'bar errored';
191
+ alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessage));
192
+ }
193
+ }
194
+
181
195
  var results = find('.results');
182
196
  results.appendChild(summary);
183
197
 
@@ -30,6 +30,7 @@ body { overflow-y: scroll; }
30
30
  .jasmine_html-reporter .bar.failed { background-color: #ca3a11; }
31
31
  .jasmine_html-reporter .bar.passed { background-color: #007069; }
32
32
  .jasmine_html-reporter .bar.skipped { background-color: #bababa; }
33
+ .jasmine_html-reporter .bar.errored { background-color: #ca3a11; }
33
34
  .jasmine_html-reporter .bar.menu { background-color: #fff; color: #aaaaaa; }
34
35
  .jasmine_html-reporter .bar.menu a { color: #333333; }
35
36
  .jasmine_html-reporter .bar a { color: white; }