Adds a fit function to Env

[#73742944]
This commit is contained in:
Greg Cobb and Tim Jarratt
2014-08-28 15:37:18 -07:00
parent 980509cd7b
commit caee1508d1
2 changed files with 38 additions and 3 deletions

View File

@@ -496,7 +496,7 @@ describe("Env integration", function() {
env.execute([secondSuite.id, firstSpec.id]);
});
it('runs before and after all functions for focused specs', function(done) {
it('runs before and after all functions for runnables provided to .execute()', function(done) {
var env = new j$.Env(),
calls = [],
first_spec,
@@ -772,7 +772,32 @@ describe("Env integration", function() {
});
});
// TODO: something is wrong with this spec
describe('focused tests', function() {
it('should only run the focused tests', function(done) {
var env = new j$.Env(),
calls = [];
var assertions = function() {
expect(calls).toEqual(['focused']);
done();
};
env.addReporter({jasmineDone: assertions});
env.describe('a suite', function() {
env.fit('is focused', function() {
calls.push('focused');
});
env.it('is not focused', function() {
calls.push('freakout');
})
});
env.execute();
});
});
it("should report as expected", function(done) {
var env = new j$.Env(),
reporter = jasmine.createSpyObj('fakeReporter', [