<commit_before>"use strict";
var assert = require("assert");
var helper = require("../../helper.js");

var utils = helper.requireModule('./utilities/utils.js');

describe("Testing utilities", function () {

    var res = {
        status: function (input) {
            return {
                send: function (input2) {
                    return input2;
                }
            };
        },
        jsonp: function () {
            return 2;
        }
    };

    var req = {
        is: () => {
            return null;
        },
        soajs: {
            log: {
                error: function (input) {
                    // console.error(input);
                }
            },
            buildResponse: function (input) {
                return input;
            },
            controllerResponse: function (input) {
                return input;
            }
        }
    };

    it("logErrors - number error", function (done) {
        utils.logErrors(123, req, res, function (error) {
            done();
        });
    });

    it("logErrors - object, no code no message", function (done) {
        utils.logErrors({}, req, res, function (error) {
            done();
        });
    });

    it("logErrors - string error", function (done) {
        utils.logErrors("error", req, res, function (error) {
            done();
        });
    });

    it("serviceClientErrorHandler - request xhr", function (done) {
        req.xhr = {};
        utils.serviceClientErrorHandler(null, req, res, (msg) => {
            consle.log(msg);
        });
        done();
    });

    it("controllerClientErrorHandler - request xhr", function (done) {
        req.xhr = {};
        utils.controllerClientErrorHandler(null, req, res, , (msg) => {
            consle.log(msg);
        });
        done();
    });

    it("serviceErrorHandler - error no code, no message", function (done) {
        req.xhr = {};
        utils.serviceErrorHandler({}, req, res, null);
        done();
    });
});<commit_msg>fixed type in test case<commit_after>"use strict";
var assert = require("assert");
var helper = require("../../helper.js");

var utils = helper.requireModule('./utilities/utils.js');

describe("Testing utilities", function () {

    var res = {
        status: function (input) {
            return {
                send: function (input2) {
                    return input2;
                }
            };
        },
        jsonp: function () {
            return 2;
        }
    };

    var req = {
        is: () => {
            return null;
        },
        soajs: {
            log: {
                error: function (input) {
                    // console.error(input);
                }
            },
            buildResponse: function (input) {
                return input;
            },
            controllerResponse: function (input) {
                return input;
            }
        }
    };

    it("logErrors - number error", function (done) {
        utils.logErrors(123, req, res, function (error) {
            done();
        });
    });

    it("logErrors - object, no code no message", function (done) {
        utils.logErrors({}, req, res, function (error) {
            done();
        });
    });

    it("logErrors - string error", function (done) {
        utils.logErrors("error", req, res, function (error) {
            done();
        });
    });

    it("serviceClientErrorHandler - request xhr", function (done) {
        req.xhr = {};
        utils.serviceClientErrorHandler(null, req, res, (msg) => {
            consle.log(msg);
        });
        done();
    });

    it("controllerClientErrorHandler - request xhr", function (done) {
        req.xhr = {};
        utils.controllerClientErrorHandler(null, req, res, (msg) => {
            consle.log(msg);
        });
        done();
    });

    it("serviceErrorHandler - error no code, no message", function (done) {
        req.xhr = {};
        utils.serviceErrorHandler({}, req, res, null);
        done();
    });
});
{'fraction_non_alphanumeric': 0.14649209486166007, 'fraction_numerical': 0.0029644268774703555, 'mean_word_length': 1.4689024390243903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4131777', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1073, 'n_words': 252}