'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _defineProperty2 = require('babel-runtime/helpers/defineProperty');

var _defineProperty3 = _interopRequireDefault(_defineProperty2);

var _STATUS_CHARACTER_MAP;

var _status = require('../status');

var _status2 = _interopRequireDefault(_status);

var _summary_formatter = require('./summary_formatter');

var _summary_formatter2 = _interopRequireDefault(_summary_formatter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var STATUS_CHARACTER_MAPPING = (_STATUS_CHARACTER_MAP = {}, (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.AMBIGUOUS, 'A'), (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.FAILED, 'F'), (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.PASSED, '.'), (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.PENDING, 'P'), (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.SKIPPED, '-'), (0, _defineProperty3.default)(_STATUS_CHARACTER_MAP, _status2.default.UNDEFINED, 'U'), _STATUS_CHARACTER_MAP);

var ProgressFormatter = function (_SummaryFormatter) {
  (0, _inherits3.default)(ProgressFormatter, _SummaryFormatter);

  function ProgressFormatter(options) {
    (0, _classCallCheck3.default)(this, ProgressFormatter);

    options.eventBroadcaster.on('test-run-finished', function () {
      _this.log('\n\n');
    });

    var _this = (0, _possibleConstructorReturn3.default)(this, (ProgressFormatter.__proto__ || Object.getPrototypeOf(ProgressFormatter)).call(this, options));

    options.eventBroadcaster.on('test-step-finished', _this.logProgress.bind(_this));
    return _this;
  }

  (0, _createClass3.default)(ProgressFormatter, [{
    key: 'logProgress',
    value: function logProgress(_ref) {
      var result = _ref.result;
      var status = result.status;

      var character = this.colorFns[status](STATUS_CHARACTER_MAPPING[status]);
      this.log(character);
    }
  }]);
  return ProgressFormatter;
}(_summary_formatter2.default);

exports.default = ProgressFormatter;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9mb3JtYXR0ZXIvcHJvZ3Jlc3NfZm9ybWF0dGVyLmpzIl0sIm5hbWVzIjpbIlNUQVRVU19DSEFSQUNURVJfTUFQUElORyIsIkFNQklHVU9VUyIsIkZBSUxFRCIsIlBBU1NFRCIsIlBFTkRJTkciLCJTS0lQUEVEIiwiVU5ERUZJTkVEIiwiUHJvZ3Jlc3NGb3JtYXR0ZXIiLCJvcHRpb25zIiwiZXZlbnRCcm9hZGNhc3RlciIsIm9uIiwibG9nIiwibG9nUHJvZ3Jlc3MiLCJyZXN1bHQiLCJzdGF0dXMiLCJjaGFyYWN0ZXIiLCJjb2xvckZucyJdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBOzs7O0FBQ0E7Ozs7OztBQUVBLElBQU1BLDZHQUNILGlCQUFPQyxTQURKLEVBQ2dCLEdBRGhCLHdEQUVILGlCQUFPQyxNQUZKLEVBRWEsR0FGYix3REFHSCxpQkFBT0MsTUFISixFQUdhLEdBSGIsd0RBSUgsaUJBQU9DLE9BSkosRUFJYyxHQUpkLHdEQUtILGlCQUFPQyxPQUxKLEVBS2MsR0FMZCx3REFNSCxpQkFBT0MsU0FOSixFQU1nQixHQU5oQix5QkFBTjs7SUFTcUJDLGlCOzs7QUFDbkIsNkJBQVlDLE9BQVosRUFBcUI7QUFBQTs7QUFDbkJBLFlBQVFDLGdCQ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