Sha256: 1d37362a0c2087a9b2573ef28f918b4a03719b445ac0dee400835eeabd2fab03

Contents?: true

Size: 1.47 KB

Versions: 13

Compression:

Stored size: 1.47 KB

Contents

describe('jasmine.Reporter', function() {
  var env;


  beforeEach(function() {
    env = new jasmine.Env();
    env.updateInterval = 0;
  });

  it('should get called from the test runner', function() {
    env.describe('Suite for JSON Reporter with Callbacks', function () {
      env.it('should be a test', function() {
        this.runs(function () {
          this.expect(true).toEqual(true);
        });
      });
      env.it('should be a failing test', function() {
        this.runs(function () {
          this.expect(false).toEqual(true);
        });
      });
    });
    env.describe('Suite for JSON Reporter with Callbacks 2', function () {
      env.it('should be a test', function() {
        this.runs(function () {
          this.expect(true).toEqual(true);
        });
      });

    });

    var foo = 0;
    var bar = 0;
    var baz = 0;

    var specCallback = function (results) {
      foo++;
    };
    var suiteCallback = function (results) {
      bar++;
    };
    var runnerCallback = function (results) {
      baz++;
    };

    env.reporter = jasmine.Reporters.reporter({
      specCallback: specCallback,
      suiteCallback: suiteCallback,
      runnerCallback: runnerCallback
    });

    var runner = env.currentRunner();
    runner.execute();

    expect(foo).toEqual(3); // 'foo was expected to be 3, was ' + foo);
    expect(bar).toEqual(2); // 'bar was expected to be 2, was ' + bar);
    expect(baz).toEqual(1); // 'baz was expected to be 1, was ' + baz);
  });

});

Version data entries

13 entries across 13 versions & 5 rubygems

Version Path
shuriken-0.2.1 vendor/jasmine-0.10.0/spec/suites/ReporterSpec.js
evergreen-0.1 lib/jasmine/spec/suites/ReporterSpec.js
shuriken-0.1.4 vendor/jasmine-0.10.0/spec/suites/ReporterSpec.js
shuriken-0.1.3.1 vendor/jasmine-0.10.0/spec/suites/ReporterSpec.js
shuriken-0.1.3 vendor/jasmine-0.10.0/spec/suites/ReporterSpec.js
jasnode-0.4.3.0 jasmine/spec/suites/ReporterSpec.js
jasnode-0.4.2.0 jasmine/spec/suites/ReporterSpec.js
jasnode-0.4.1.0 jasmine/spec/suites/ReporterSpec.js
jasnode-0.4.0.0 jasmine/spec/suites/ReporterSpec.js
jasnode-0.2.0.0 jasmine/spec/suites/ReporterSpec.js
jazz-0.1.1 vendor/jasmine/spec/suites/ReporterSpec.js
jazrb-0.1.1 vendor/jasmine/spec/suites/ReporterSpec.js
jazrb-0.1.0 vendor/jasmine/spec/suites/ReporterSpec.js