Rewrite Spec & allow Jasmine to be namespaced

- THere seems to be a performance regression. Large test suites may
  throw
- Regressions: Mock Clock won't install correctly, async specs are
  temporarily not supported.
- Async spec runs/waits interface is gone. Blocks are gone.
- Move most global usage into jasmine.Env constructor.
- Remove optional 'Jasmine running' from HtmlReporter -- caused
  NS_FACTORY_ERROR in firefox when tested
This commit is contained in:
Davis W. Frank & Rajan Agaskar
2012-12-05 09:37:05 -08:00
parent 779dee1211
commit a1011e7748
44 changed files with 1343 additions and 2586 deletions

View File

@@ -90,7 +90,7 @@ describe('RunnerTest', function() {
env.describe('suite',function() {
env.it('fails', function() {
this.fail();
this.expect(true).toBe(false);
});
}).execute();
@@ -107,31 +107,20 @@ describe('RunnerTest', function() {
describe('reporting', function() {
var fakeReporter;
beforeEach(function() {
fakeReporter = originalJasmine.createSpyObj("fakeReporter", ["log", "reportRunnerStarting", "reportRunnerResults"]);
env.addReporter(fakeReporter);
});
it('should report runner results when the runner has completed running', function() {
env.describe('one suite description', function() {
env.it('should be a test', function() {
this.runs(function() {
this.expect(true).toEqual(true);
});
});
var specSpy = originalJasmine.createSpy('spec').andCallFake(function() {
expect(fakeReporter.reportRunnerResults).not.toHaveBeenCalled();
});
env.describe('another suite description', function() {
env.it('should be another test', function() {
this.waits(200);
this.runs(function() {
this.expect(true).toEqual(false);
});
});
env.describe('description', function() {
env.it('should be a test', specSpy);
});
env.currentRunner().execute();
expect(fakeReporter.reportRunnerResults).not.toHaveBeenCalled();
fakeTimer.tick(200);
expect(specSpy).toHaveBeenCalled();
expect(fakeReporter.reportRunnerResults).toHaveBeenCalledWith(env.currentRunner());
});
});