Compare commits

...

10 Commits

Author SHA1 Message Date
Gregg Van Hove
0b1449228f Bump version to 2.3.4 2015-05-13 14:57:56 -07:00
Gregg Van Hove
65a6decd6d Fix ordering for suites with more than 11 direct children.
- When no specs were focused, they all had the same precedence, and
  `sort`ing them caused some of the nodes to move around

Fixes #850
2015-05-13 14:45:11 -07:00
Gregg Van Hove
7cbd86357d Merge branch 'remove-dead-css' of https://github.com/prather-mcs/jasmine into prather-mcs-remove-dead-css 2015-05-13 11:03:25 -07:00
Gregg Van Hove
4f278be2c2 Update standalone installation instructions to reference the releases page
Fix #603
2015-05-13 10:59:39 -07:00
Matt Prather
f2bc9b5bd8 Remove the style rule for .running-alert CSS class
https://github.com/jasmine/jasmine/issues/847#issuecomment-101446573
2015-05-12 15:51:42 -07:00
Gregg Van Hove
e9d79bc946 Merge branch 'prather-mcs-remove-dead-css' 2015-05-11 10:59:36 -07:00
Gregg Van Hove
0b2097b616 Bump version to 2.3.3 2015-05-11 10:48:58 -07:00
Gregg Van Hove
f02824ae52 Merge branch 'remove-dead-css' of https://github.com/prather-mcs/jasmine into prather-mcs-remove-dead-css 2015-05-11 10:41:18 -07:00
Robert Neumann
225c7bdda3 Set the shared user context correctly when executing the top level suite
Fixes #846
2015-05-11 10:29:51 -07:00
Matt Prather
e855c898d1 Remove dead CSS class styles
I removed the `.showDetails` and `.summaryMenuItem` styles from the Sass
file because I believe that no HTML elements with those classes will
ever be generated by Jasmine and that they are dead code that someone
forgot to remove.

This is my first contribution to the Jasmine project and so I might be
doing something wrong, but I believe just this one change will propagate
to all the generated code when it is built, and that I should not be
altering any other code in any other place to accomplish the change I
intend.

This is related to Jasmine Issue 847:
https://github.com/jasmine/jasmine/issues/847
2015-05-10 16:58:07 -07:00
11 changed files with 131 additions and 76 deletions

View File

@@ -28,11 +28,11 @@ For the Jasmine Ruby Gem:<br>
For the Jasmine Python Egg:<br>
[https://github.com/jasmine/jasmine-py](https://github.com/jasmine/jasmine-py)
To install Jasmine on your local box:
To install Jasmine standalone on your local box:
* Clone Jasmine - `git clone https://github.com/jasmine/jasmine.git`
* Download the standalone distribution for your desired release from the [releases page](https://github.com/jasmine/jasmine/releases)
* Create a Jasmine directory in your project - `mkdir my-project/jasmine`
* Move latest dist to your project directory - `mv jasmine/dist/jasmine-standalone-2.0.0.zip my-project/jasmine`
* Move the dist to your project directory - `mv jasmine/dist/jasmine-standalone-2.0.0.zip my-project/jasmine`
* Change directory - `cd my-project/jasmine`
* Unzip the dist - `unzip jasmine-standalone-2.0.0.zip`
@@ -62,6 +62,8 @@ Jasmine tests itself across many browsers (Safari, Chrome, Firefox, PhantomJS, a
* [Davis W. Frank](mailto:dwfrank@pivotal.io), Pivotal Labs
* [Rajan Agaskar](mailto:rajan@pivotal.io), Pivotal Labs
* [Gregg Van Hove](mailto:gvanhove@pivotal.io), Pivotal Labs
* [Greg Cobb](mailto:gcobb@pivotal.io), Pivotal Labs
* [Chris Amavisca](mailto:camavisca@pivotal.io), Pivotal Labs
### Maintainers Emeritus

View File

@@ -1,6 +1,6 @@
{
"name": "jasmine-core",
"version": "2.3.2",
"version": "2.3.4",
"homepage": "http://jasmine.github.io",
"authors": [
"slackersoft <gregg@slackersoft.net>"

View File

@@ -38,14 +38,7 @@ body { overflow-y: scroll; }
.jasmine_html-reporter .bar a { color: white; }
.jasmine_html-reporter.spec-list .bar.menu.failure-list, .jasmine_html-reporter.spec-list .results .failures { display: none; }
.jasmine_html-reporter.failure-list .bar.menu.spec-list, .jasmine_html-reporter.failure-list .summary { display: none; }
.jasmine_html-reporter .running-alert { background-color: #666; }
.jasmine_html-reporter .results { margin-top: 14px; }
.jasmine_html-reporter.showDetails .summaryMenuItem { font-weight: normal; text-decoration: inherit; }
.jasmine_html-reporter.showDetails .summaryMenuItem:hover { text-decoration: underline; }
.jasmine_html-reporter.showDetails .detailsMenuItem { font-weight: bold; text-decoration: underline; }
.jasmine_html-reporter.showDetails .summary { display: none; }
.jasmine_html-reporter.showDetails #details { display: block; }
.jasmine_html-reporter .summaryMenuItem { font-weight: bold; text-decoration: underline; }
.jasmine_html-reporter .summary { margin-top: 14px; }
.jasmine_html-reporter .summary ul { list-style-type: none; margin-left: 14px; padding-top: 0; padding-left: 0; }
.jasmine_html-reporter .summary ul.suite { margin-top: 7px; margin-bottom: 7px; }

View File

@@ -2208,6 +2208,7 @@ getJasmineRequireObj().TreeProcessor = function() {
queueRunnerFactory({
queueableFns: childFns,
userContext: tree.sharedUserContext(),
onException: function() {
tree.onException.apply(tree, arguments);
},
@@ -2310,30 +2311,29 @@ getJasmineRequireObj().TreeProcessor = function() {
}
function orderChildSegments(children) {
var result = [];
var specifiedOrder = [],
unspecifiedOrder = [];
for (var i = 0; i < children.length; i++) {
var child = children[i],
segments = stats[child.id].segments;
for (var j = 0; j < segments.length; j++) {
result.push(segments[j]);
var seg = segments[j];
if (seg.min === defaultMin) {
unspecifiedOrder.push(seg);
} else {
specifiedOrder.push(seg);
}
}
}
result.sort(function(a, b) {
if (a.min === null) {
return b.min === null ? 0 : 1;
}
if (b.min === null) {
return -1;
}
specifiedOrder.sort(function(a, b) {
return a.min - b.min;
});
return result;
return specifiedOrder.concat(unspecifiedOrder);
}
function executeNode(node, segmentNumber) {
@@ -3294,5 +3294,5 @@ getJasmineRequireObj().interface = function(jasmine, env) {
};
getJasmineRequireObj().version = function() {
return '2.3.2';
return '2.3.4';
};

View File

@@ -4,6 +4,6 @@
#
module Jasmine
module Core
VERSION = "2.3.2"
VERSION = "2.3.4"
end
end

View File

@@ -1,7 +1,7 @@
{
"name": "jasmine-core",
"license": "MIT",
"version": "2.3.2",
"version": "2.3.4",
"repository": {
"type": "git",
"url": "https://github.com/jasmine/jasmine.git"

14
release_notes/2.3.3.md Normal file
View File

@@ -0,0 +1,14 @@
# Jasmine 2.3.3 Release Notes
## Summary
This is a hotfix release to fix a regression with the execution context for `beforeAll`
## Pull Requests & Issues
* Set the shared user context correctly when executing the top level suite
- Fixes [#846](https://github.com/jasmine/jasmine/issues/846)
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

22
release_notes/2.3.4.md Normal file
View File

@@ -0,0 +1,22 @@
# Jasmine 2.3.4 Release Notes
## Summary
This is a hotfix release to fix a regression with execution ordering
## Pull Requests & Issues
* Fix ordering for suites with more than 11 direct children.
- Fixes [#850](https://github.com/jasmine/jasmine/issues/850)
* Update standalone installation instructions to reference the releases page
- Fixes [#603](https://github.com/jasmine/jasmine/issues/603)
* Remove dead CSS class styles
- Merges [#849](https://github.com/jasmine/jasmine/issues/849) from @prather-mcs
- Merges [#848](https://github.com/jasmine/jasmine/issues/848) from @prather-mcs
- Fixes [#847](https://github.com/jasmine/jasmine/issues/847)
------
_Release Notes generated with _[Anchorman](http://github.com/infews/anchorman)_

View File

@@ -202,7 +202,7 @@ describe("TreeProcessor", function() {
it("runs a single leaf", function() {
var leaf = new Leaf(),
node = new Node({ children: [leaf] }),
node = new Node({ children: [leaf], userContext: { root: 'context' } }),
queueRunner = jasmine.createSpy('queueRunner'),
processor = new j$.TreeProcessor({ tree: node, runnableIds: [leaf.id], queueRunnerFactory: queueRunner }),
treeComplete = jasmine.createSpy('treeComplete');
@@ -212,6 +212,7 @@ describe("TreeProcessor", function() {
expect(queueRunner).toHaveBeenCalledWith({
onComplete: treeComplete,
onException: jasmine.any(Function),
userContext: { root: 'context' },
queueableFns: [{ fn: jasmine.any(Function) }]
});
@@ -222,7 +223,7 @@ describe("TreeProcessor", function() {
it("runs a node with no children", function() {
var node = new Node({ userContext: { node: 'context' } }),
root = new Node({ children: [node] }),
root = new Node({ children: [node], userContext: { root: 'context' } }),
nodeStart = jasmine.createSpy('nodeStart'),
nodeComplete = jasmine.createSpy('nodeComplete'),
queueRunner = jasmine.createSpy('queueRunner'),
@@ -241,6 +242,7 @@ describe("TreeProcessor", function() {
expect(queueRunner).toHaveBeenCalledWith({
onComplete: treeComplete,
onException: jasmine.any(Function),
userContext: { root: 'context' },
queueableFns: [{ fn: jasmine.any(Function) }]
});
@@ -630,4 +632,62 @@ describe("TreeProcessor", function() {
childFns[1].fn();
expect(leaf3.execute).toHaveBeenCalled();
});
it("runs large segments of nodes in the order they were declared", function() {
var leaf1 = new Leaf(),
leaf2 = new Leaf(),
leaf3 = new Leaf(),
leaf4 = new Leaf(),
leaf5 = new Leaf(),
leaf6 = new Leaf(),
leaf7 = new Leaf(),
leaf8 = new Leaf(),
leaf9 = new Leaf(),
leaf10 = new Leaf(),
leaf11 = new Leaf(),
root = new Node({ children: [leaf1, leaf2, leaf3, leaf4, leaf5, leaf6, leaf7, leaf8, leaf9, leaf10, leaf11] }),
queueRunner = jasmine.createSpy('queueRunner'),
processor = new j$.TreeProcessor({
tree: root,
runnableIds: [root.id],
queueRunnerFactory: queueRunner
});
processor.execute();
var queueableFns = queueRunner.calls.mostRecent().args[0].queueableFns;
expect(queueableFns.length).toBe(11);
queueableFns[0].fn();
expect(leaf1.execute).toHaveBeenCalled();
queueableFns[1].fn();
expect(leaf2.execute).toHaveBeenCalled();
queueableFns[2].fn();
expect(leaf3.execute).toHaveBeenCalled();
queueableFns[3].fn();
expect(leaf4.execute).toHaveBeenCalled();
queueableFns[4].fn();
expect(leaf5.execute).toHaveBeenCalled();
queueableFns[5].fn();
expect(leaf6.execute).toHaveBeenCalled();
queueableFns[6].fn();
expect(leaf7.execute).toHaveBeenCalled();
queueableFns[7].fn();
expect(leaf8.execute).toHaveBeenCalled();
queueableFns[8].fn();
expect(leaf9.execute).toHaveBeenCalled();
queueableFns[9].fn();
expect(leaf10.execute).toHaveBeenCalled();
queueableFns[10].fn();
expect(leaf11.execute).toHaveBeenCalled();
});
});

View File

@@ -29,6 +29,7 @@ getJasmineRequireObj().TreeProcessor = function() {
queueRunnerFactory({
queueableFns: childFns,
userContext: tree.sharedUserContext(),
onException: function() {
tree.onException.apply(tree, arguments);
},
@@ -131,30 +132,29 @@ getJasmineRequireObj().TreeProcessor = function() {
}
function orderChildSegments(children) {
var result = [];
var specifiedOrder = [],
unspecifiedOrder = [];
for (var i = 0; i < children.length; i++) {
var child = children[i],
segments = stats[child.id].segments;
for (var j = 0; j < segments.length; j++) {
result.push(segments[j]);
var seg = segments[j];
if (seg.min === defaultMin) {
unspecifiedOrder.push(seg);
} else {
specifiedOrder.push(seg);
}
}
}
result.sort(function(a, b) {
if (a.min === null) {
return b.min === null ? 0 : 1;
}
if (b.min === null) {
return -1;
}
specifiedOrder.sort(function(a, b) {
return a.min - b.min;
});
return result;
return specifiedOrder.concat(unspecifiedOrder);
}
function executeNode(node, segmentNumber) {

View File

@@ -245,48 +245,12 @@ body {
}
}
.running-alert {
background-color: $light-text-color;
}
//--- Results ---//
.results {
margin-top: $line-height;
}
//--- Results menu ---//
&.showDetails {
.summaryMenuItem {
font-weight: normal;
text-decoration: inherit;
&:hover {
text-decoration: underline;
}
}
.detailsMenuItem {
font-weight: bold;
text-decoration: underline;
}
.summary {
display: none;
}
#details {
display: block;
}
}
.summaryMenuItem {
font-weight: bold;
text-decoration: underline;
}
//--- Results summary: Suites and Specs names/links ---//
.summary {