Parallel: throw if Env#topSuite is called
This commit is contained in:
@@ -1542,6 +1542,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
this.topSuite = function() {
|
this.topSuite = function() {
|
||||||
|
ensureNonParallel('topSuite');
|
||||||
return topSuite.metadata;
|
return topSuite.metadata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,19 @@ describe('Env', function() {
|
|||||||
);
|
);
|
||||||
expect(suite.children[1].children[1].children[0].children).toBeFalsy();
|
expect(suite.children[1].children[1].children[0].children).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('throws if called in parallel mode', function() {
|
||||||
|
env.setParallelLoadingState('helpers');
|
||||||
|
check();
|
||||||
|
env.setParallelLoadingState('specs');
|
||||||
|
check();
|
||||||
|
|
||||||
|
function check() {
|
||||||
|
expect(function() {
|
||||||
|
env.topSuite();
|
||||||
|
}).toThrowError("'topSuite' is not available in parallel mode");
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts its own current configureation', function() {
|
it('accepts its own current configureation', function() {
|
||||||
|
|||||||
@@ -400,6 +400,7 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
*/
|
*/
|
||||||
this.topSuite = function() {
|
this.topSuite = function() {
|
||||||
|
ensureNonParallel('topSuite');
|
||||||
return topSuite.metadata;
|
return topSuite.metadata;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user