<commit_before>beforeEach(function () {
	Blockly.inject(document.body.appendChild(document.createElement("div")));
});

describe("goBlockly:blocks:simpleState:js", function() {
    it("should generate a text length lookup", function() {
        var text = Blockly.Block.obtain(Blockly.mainWorkspace, 'text');
        text.setFieldValue('foo', 'TEXT');

        var block = Blockly.Block.obtain(Blockly.mainWorkspace, 'simpleState');
        block.getInput('NAME').connection.connect(text.outputConnection);

        assert.equal(Blockly.JavaScript.workspaceToCode(), "'foo'.length");
    });
});<commit_msg>Adds afterEach to tests to remove divs after testing is complete.<commit_after>var el;

beforeEach(function () {
	el = document.createElement("div");
	Blockly.inject(document.body.appendChild(el));
});

afterEach(function () {
	document.body.removeChild(el);
});

describe("goBlockly:blocks:simpleState:js", function() {
    it("should generate a text length lookup", function() {
        var text = Blockly.Block.obtain(Blockly.mainWorkspace, 'text');
        text.setFieldValue('foo', 'TEXT');

        var block = Blockly.Block.obtain(Blockly.mainWorkspace, 'simpleState');
        block.getInput('NAME').connection.connect(text.outputConnection);

        assert.equal(Blockly.JavaScript.workspaceToCode(), "'foo'.length");
    });
});
{'fraction_non_alphanumeric': 0.16047548291233285, 'fraction_numerical': 0.0, 'mean_word_length': 4.756410256410256, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '910512', 'n_tokens_mistral': 388, 'n_tokens_neox': 388, 'n_words': 64}