Add focused describe

[#73742944]
This commit is contained in:
Greg Cobb and Tim Jarratt
2014-08-28 15:43:59 -07:00
parent caee1508d1
commit d7ab9083be
2 changed files with 32 additions and 0 deletions

View File

@@ -796,6 +796,32 @@ describe("Env integration", function() {
env.execute();
});
it('should only run focused suites', function(){
var env = new j$.Env(),
calls = [];
var assertions = function() {
expect(calls).toEqual(['focused']);
done();
};
env.addReporter({jasmineDone: assertions});
env.fdescribe('a focused suite', function() {
env.it('is focused', function() {
calls.push('focused');
});
});
env.describe('a regular suite', function() {
env.it('is not focused', function() {
calls.push('freakout');
})
});
env.execute();
});
});
it("should report as expected", function(done) {

View File

@@ -293,6 +293,12 @@ getJasmineRequireObj().Env = function(j$) {
return suite;
};
this.fdescribe = function(description, specDefinitions) {
var suite = this.describe(description, specDefinitions);
focusedRunnables.push(suite.id);
return suite;
};
var runnablesExplictlySet = false;
var runnablesExplictlySetGetter = function(){