Set the shared user context correctly when executing the top level suite

Fixes #846
This commit is contained in:
Robert Neumann
2015-05-11 10:29:51 -07:00
parent 426eebe1ce
commit 225c7bdda3
3 changed files with 6 additions and 2 deletions

View File

@@ -2208,6 +2208,7 @@ getJasmineRequireObj().TreeProcessor = function() {
queueRunnerFactory({
queueableFns: childFns,
userContext: tree.sharedUserContext(),
onException: function() {
tree.onException.apply(tree, arguments);
},

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) }]
});

View File

@@ -29,6 +29,7 @@ getJasmineRequireObj().TreeProcessor = function() {
queueRunnerFactory({
queueableFns: childFns,
userContext: tree.sharedUserContext(),
onException: function() {
tree.onException.apply(tree, arguments);
},