Expose Jasmine's topSuite [finishes #59774024]

This commit is contained in:
Sheel Choksi
2013-10-29 11:27:12 -07:00
parent cd9d5284cd
commit 61993cf1fc
2 changed files with 10 additions and 0 deletions

View File

@@ -92,6 +92,12 @@ describe("Env", function() {
});
});
describe("#topSuite", function() {
it("returns the Jasmine top suite for users to traverse the spec tree", function() {
var suite = env.topSuite();
expect(suite.description).toEqual('Jasmine__TopLevel__Suite');
});
});
});
// TODO: move these into a separate file

View File

@@ -150,6 +150,10 @@ getJasmineRequireObj().Env = function(j$) {
runnableLookupTable[topSuite.id] = topSuite;
currentSuite = topSuite;
this.topSuite = function() {
return topSuite;
};
this.execute = function(runnablesToRun) {
runnablesToRun = runnablesToRun || [topSuite.id];