diff --git a/spec/core/integration/EnvSpec.js b/spec/core/integration/EnvSpec.js index 383d9662..8b41fb83 100644 --- a/spec/core/integration/EnvSpec.js +++ b/spec/core/integration/EnvSpec.js @@ -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) { diff --git a/src/core/Env.js b/src/core/Env.js index db079a60..7a17044d 100644 --- a/src/core/Env.js +++ b/src/core/Env.js @@ -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(){