<commit_before>var buster = require("buster-core");
var consoleReporter = require("./console");
var terminal = require("buster-terminal");

function messages(reporter, context, test) {
    if (!context || !test) {
        reporter.globalMessageLog = reporter.globalMessageLog || [];
        return reporter.globalMessageLog;
    }

    reporter.messageLog = reporter.messageLog || {};
    reporter.messageLog[context] = reporter.messageLog[context] || {};
    reporter.messageLog[context][test] = reporter.messageLog[context][test] || [];

    return reporter.messageLog[context][test];
}

module.exports = buster.extend(buster.create(consoleReporter), {
    create: function (opt) {
        opt = opt || {};
        var reporter = buster.create(this);
        reporter.io = opt.io || require("util");
        reporter.logPassedMessages = !!opt.logPassedMessages;
        reporter.term = terminal.create(opt);
        reporter.cwd = opt.cwd;
        reporter.displayProgress = typeof opt.displayProgress == "boolean" ? opt.displayProgress : true;
        reporter.reset();

        return reporter;
    },

    listen: function (runner) {
        runner.bind(this, {
            "suite:start": "reset", "suite:end": "printDetails",
            "context:start": "startContext", "context:end": "endContext",
            "context:unsupported": "unsupportedContext",
            "test:success": "testSuccess", "test:error": "testError",
            "test:failure": "testFailure", "test:async": "testAsync",
            "test:timeout": "testTimeout", "test:setUp": "testSetUp",
            "test:deferred": "testDeferred", "uncaughtException": "uncaughtException"
        });

        if (runner.console) {
            runner.console.bind(this, "log");
        }

        return this;
    },

    testSetUp: function (test) {
        this.currentTest = test.name;
    },

    testSuccess: function (test) {
        this.replaceAsyncMarker();
        this.printProgress(this.term.green("."));
    },

    testError: function (test) {
        this.replaceAsyncMarker();
        test.contextName = (this.contextNames || []).join(" ");
        this.errors.push(test);
        this.printProgress(this.term.yellow("E"));<commit_msg>Print some bling from the dots reporter when in focus mode<commit_after>var buster = require("buster-core");
var consoleReporter = require("./console");
var terminal = require("buster-terminal");

function messages(reporter, context, test) {
    if (!context || !test) {
        reporter.globalMessageLog = reporter.globalMessageLog || [];
        return reporter.globalMessageLog;
    }

    reporter.messageLog = reporter.messageLog || {};
    reporter.messageLog[context] = reporter.messageLog[context] || {};
    reporter.messageLog[context][test] = reporter.messageLog[context][test] || [];

    return reporter.messageLog[context][test];
}

module.exports = buster.extend(buster.create(consoleReporter), {
    create: function (opt) {
        opt = opt || {};
        var reporter = buster.create(this);
        reporter.io = opt.io || require("util");
        reporter.logPassedMessages = !!opt.logPassedMessages;
        reporter.term = terminal.create(opt);
        reporter.cwd = opt.cwd;
        reporter.displayProgress = typeof opt.displayProgress == "boolean" ? opt.displayProgress : true;
        reporter.reset();

        return reporter;
    },

    listen: function (runner) {
        runner.bind(this, {
            "suite:start": "reset", "suite:end": "printDetails",
            "context:start": "startContext", "context:end": "endContext",
            "context:unsupported": "unsupportedContext",
            "test:success": "testSuccess", "test:error": "testError",
            "test:failure": "testFailure", "test:async": "testAsync",
            "test:timeout": "testTimeout", "test:setUp": "testSetUp",
            "test:deferred": "testDeferred", "runner:focus": "focusMode",
            "uncaughtException": "uncaughtException"
        });

        if (runner.console) {
            runner.console.bind(this, "log");
        }

        return this;
    },

    focusMode: function () {
        this.io.puts([
            this.term.grey("=> "),
            "注",
            this.term.grey(" (concentrate, focus, direct)")
        ].join(""));
        this.io.puts("");
    },

    testSetUp: function (test) {
        this.currentTest = test.name;
    },

    testSuccess: function (test) {
        this.replaceAsyncMarker();
        this.printProgress(this.term.green("."));
    },

    testError: function (test) {
        this.replaceAsyncMarker();
        test.contextName = (this.contextNames || []).join(" ");
        this.errors.push(test);
        this.printProgress(this.term.yellow("E"));
{'fraction_non_alphanumeric': 0.1563092479460712, 'fraction_numerical': 0.0, 'mean_word_length': 2.8167202572347265, 'pattern_counts': {'":': 27, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608124', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1342, 'n_words': 244}