aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/karma-spec-reporter/test/index.spec.js
blob: 60e78c7fdfd8e9092fb00cdacdaff95caa0b4c71 (plain)
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
36
37
38
39
40
'use strict';
var should = require('chai').should();
var SpecReporter = require('../index')['reporter:spec'];
var formatError = function (a, b) {
  return a + b;
};
var noop = function noop() {};
var baseReporterDecorator = function (context) {
  context.renderBrowser = noop;
  context.writeCommonMsg = noop;
  context.write = noop;
};
var config = {};
describe('SpecReporter', function () {
  describe('when initializing', function () {
    describe('and colors are not defined', function () {
      var newSpecReporter;
      
      beforeEach(function () {
        newSpecReporter = new SpecReporter[1](baseReporterDecorator, formatError, config);
      });
      
      it('SpecReporter should be defined appropriately', function () {
        SpecReporter[0].should.equal('type');
        newSpecReporter.should.be.a('object');
      });
      
      it('should set USE_COLORS to false', function () {
        newSpecReporter.USE_COLORS.should.equal(false);
      });

      it('should reset currentSuite array on run complete', function () {
        newSpecReporter.currentSuite.push('suite name');
        newSpecReporter.onRunComplete([]);

        newSpecReporter.currentSuite.length.should.equal(0);
      });
    });
  });
});