Sha256: 7fb37522d8cd63199ae0d7737bbc06d15dc07453dd98fa1debfa7a96b73989e8

Contents?: true

Size: 1.71 KB

Versions: 29

Compression:

Stored size: 1.71 KB

Contents

/**
 * Holds results for a set of Jasmine spec. Allows for the results array to hold another jasmine.NestedResults
 *
 * @constructor
 */
jasmine.NestedResults = function() {
  /**
   * The total count of results
   */
  this.totalCount = 0;
  /**
   * Number of passed results
   */
  this.passedCount = 0;
  /**
   * Number of failed results
   */
  this.failedCount = 0;
  /**
   * Was this suite/spec skipped?
   */
  this.skipped = false;
  /**
   * @ignore
   */
  this.items_ = [];
};

/**
 * Roll up the result counts.
 *
 * @param result
 */
jasmine.NestedResults.prototype.rollupCounts = function(result) {
  this.totalCount += result.totalCount;
  this.passedCount += result.passedCount;
  this.failedCount += result.failedCount;
};

/**
 * Adds a log message.
 * @param values Array of message parts which will be concatenated later.
 */
jasmine.NestedResults.prototype.log = function(values) {
  this.items_.push(new jasmine.MessageResult(values));
};

/**
 * Getter for the results: message & results.
 */
jasmine.NestedResults.prototype.getItems = function() {
  return this.items_;
};

/**
 * Adds a result, tracking counts (total, passed, & failed)
 * @param {jasmine.ExpectationResult|jasmine.NestedResults} result
 */
jasmine.NestedResults.prototype.addResult = function(result) {
  if (result.type != 'log') {
    if (result.items_) {
      this.rollupCounts(result);
    } else {
      this.totalCount++;
      if (result.passed()) {
        this.passedCount++;
      } else {
        this.failedCount++;
      }
    }
  }
  this.items_.push(result);
};

/**
 * @returns {Boolean} True if <b>everything</b> below passed
 */
jasmine.NestedResults.prototype.passed = function() {
  return this.passedCount === this.totalCount;
};

Version data entries

29 entries across 29 versions & 7 rubygems

Version Path
evergreen-1.3.0 lib/jasmine/src/core/NestedResults.js
evergreen-1.2.0 lib/jasmine/src/core/NestedResults.js
evergreen-1.1.3 lib/jasmine/src/core/NestedResults.js
evergreen-1.1.2 lib/jasmine/src/core/NestedResults.js
evergreen-1.1.0 lib/jasmine/src/core/NestedResults.js
evergreen-1.0.1 lib/jasmine/src/core/NestedResults.js
evergreen-1.0.0 lib/jasmine/src/core/NestedResults.js
evergreen-1.0.0.rc lib/jasmine/src/NestedResults.js
rails31-evergreen-0.4.1 lib/jasmine/src/NestedResults.js
evergreen-0.4.1 lib/jasmine/src/NestedResults.js
josephholsten-jasmine-1.1.0.pre.10 jasmine/src/NestedResults.js
jasmine-1.0.2.1 jasmine/src/NestedResults.js
josephholsten-jasmine-1.1.0.pre.1 jasmine/src/NestedResults.js
js-test-driver-rails-0.3.0 vendor/jasmine/src/NestedResults.js
jasmine-1.0.2.0 jasmine/src/NestedResults.js
danieldkim-evergreen-0.4.0.6 lib/jasmine/src/NestedResults.js
gjastrab-evergreen-0.4.0.3 lib/jasmine/src/NestedResults.js
js-test-driver-rails-0.2.9 vendor/jasmine/src/NestedResults.js
js-test-driver-rails-0.2.8 vendor/jasmine/src/NestedResults.js
js-test-driver-rails-0.2.7 vendor/jasmine/src/NestedResults.js