Blame view

framework/thirdparty/jasmine/src/MultiReporter.js 932 Bytes
0084d336   Administrator   Importers CRUD
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
  /**
   * @constructor
   */
  jasmine.MultiReporter = function() {
    this.subReporters_ = [];
  };
  jasmine.util.inherit(jasmine.MultiReporter, jasmine.Reporter);
  
  jasmine.MultiReporter.prototype.addReporter = function(reporter) {
    this.subReporters_.push(reporter);
  };
  
  (function() {
    var functionNames = [
      "reportRunnerStarting",
      "reportRunnerResults",
      "reportSuiteResults",
      "reportSpecStarting",
      "reportSpecResults",
      "log"
    ];
    for (var i = 0; i < functionNames.length; i++) {
      var functionName = functionNames[i];
      jasmine.MultiReporter.prototype[functionName] = (function(functionName) {
        return function() {
          for (var j = 0; j < this.subReporters_.length; j++) {
            var subReporter = this.subReporters_[j];
            if (subReporter[functionName]) {
              subReporter[functionName].apply(subReporter, arguments);
            }
          }
        };
      })(functionName);
    }
  })();