<commit_before>define(["mocha/mocha", "chai", "jquery", "wed/wed", "rangy"],
function (mocha, chai, $, wed, rangy) {
    var assert = chai.assert;

    var wedroot = $("#wedframe-invisible").contents().find("#wedroot").get(0);
    var $wedroot = $(wedroot);
    var source = "../../test-files/wed_test_data/source_converted.xml";

    function caretCheck(editor, container, offset, msg) {
        assert.equal(editor._raw_caret[0], container, msg + " (container)");
        assert.equal(editor._raw_caret[1], offset, msg + " (offset)");
    }

    function firstGUI($container) {
        return $container.children("._gui").get(0);
    }

    function lastGUI($container) {
        return $container.children("._gui").last().get(0);
    }

    function firstPH($container) {
        return $container.children("._placeholder").get(0).childNodes[0];
    }

    function lastPH($container) {
        return $container.children("._placeholder").last().
            get(0).childNodes[0];
    }


    describe("wed", function () {
        var editor;
        beforeEach(function (done) {
            $wedroot.empty();
            require(["requirejs/text!" + source], function(data) {
                $wedroot.append(data);
                editor = new wed.Editor();
                editor.addEventListener("initialized", function () {
                    done();
                });
                editor.init(wedroot);
            });
        });

        afterEach(function () {
            if (editor)
                editor.destroy();
            editor = undefined;
        });

        it("starts with an undefined caret", function () {
            assert.equal(editor.getCaret(), undefined, "no caret");
        });
<commit_msg>Use local options to set a test value for the mode.<commit_after>define(["mocha/mocha", "chai", "jquery", "wed/wed", "rangy"],
function (mocha, chai, $, wed, rangy) {
    var options = {
        schema: 'test/tei-simplified-rng.js',
        mode: {
            path: 'wed/modes/generic/generic',
            options: {
                meta: 'wed/modes/generic/metas/tei_meta',
                // This option is for testing only, not to be used as
                // part of normal operations. It may change at any
                // time, without warning, and without documentation.
                __test: {
                    no_element_decoration: ["term"]
                }
            }
        }
    };
    var assert = chai.assert;

    var wedroot = $("#wedframe-invisible").contents().find("#wedroot").get(0);
    var $wedroot = $(wedroot);
    var source = "../../test-files/wed_test_data/source_converted.xml";

    function caretCheck(editor, container, offset, msg) {
        assert.equal(editor._raw_caret[0], container, msg + " (container)");
        assert.equal(editor._raw_caret[1], offset, msg + " (offset)");
    }

    function firstGUI($container) {
        return $container.children("._gui").get(0);
    }

    function lastGUI($container) {
        return $container.children("._gui").last().get(0);
    }

    function firstPH($container) {
        return $container.children("._placeholder").get(0).childNodes[0];
    }

    function lastPH($container) {
        return $container.children("._placeholder").last().
            get(0).childNodes[0];
    }


    describe("wed", function () {
        var editor;
        beforeEach(function (done) {
            $wedroot.empty();
            require(["requirejs/text!" + source], function(data) {
                $wedroot.append(data);
                editor = new wed.Editor();
                editor.addEventListener("initialized", function () {
                    done();
                });
                editor.init(wedroot, options);
            });
        });

        afterEach(function () {
            if (editor)
                editor.destroy();
            editor = undefined;
        });

        it("starts with an undefined caret", function () {
            assert.equal(editor.getCaret(), undefined, "no caret");
        });

{'fraction_non_alphanumeric': 0.15392205229403058, 'fraction_numerical': 0.004440059200789344, 'mean_word_length': 1.992619926199262, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '737642', 'n_tokens_mistral': 1149, 'n_tokens_neox': 1099, 'n_words': 222}