All files / lib/reporter dots.js

100% Statements 16/16
100% Branches 2/2
100% Functions 5/5
100% Lines 16/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 41 42 43 44                1x   1x 1x 1x   1x 1x     3x 2x 2x 2x         1x       1x       1x 206x   1x 1x          
"use strict";
 
/**
 * Glace dots reporter.
 *
 * @module
 */
 
require("colors");
 
const CONF = require("../config");
const TestCase = require("../testing").TestCase;
const utils = require("../utils");
 
let i = 0;
module.exports = {
 
    suite: suite => {
        if (suite.title.toString() == CONF.session.name) {
            const msg = Array(i).join("\n") + ">".cyan.bold + " ";
            process.stdout.write(msg);
            i = 2;
        }
    },
 
    pass: () => {
        process.stdout.write(".".green);
    },
 
    fail: () => {
        process.stdout.write("x".red);
    },
 
    end: () => {
        const failedTests = CONF.test.cases.filter(
            t => t.status === TestCase.FAILED);
 
        utils.printTestErrors(failedTests);
        utils.printSessionErrors();
    },
 
    done: console.log,
};