<commit_before>define(["pat-masonry"], function(pattern) {

    describe("pat-masonry", function() {
        beforeEach(function() {
            $("<div/>", {id: "lab"}).appendTo(document.body);
        });
        afterEach(function() {
            $("#lab").remove();
        });

        it("Sets class masonry-ready on the element after masonry has finished", function() {
            $("#lab").html(
                "<div class='pat-masonry'>" +
                "  <div class='item'>" +
                "    <img src='http://i.imgur.com/6Lo8oun.jpg'>"+
                "  </div>" +
                "  <div class='item'>" +
                "    <img src='http://i.imgur.com/HDSAMFl.jpg'>"+
                "  </div>" +
                "</div>");
            var $msnry = $("#lab .pat-masonry");
            expect($msnry.hasClass("masonry-ready")).toBeFalsy();
            runs(function () {
                pattern.init($msnry);
            });
            waits(300);
            runs(function () {
                expect($msnry.hasClass("masonry-ready")).toBeTruthy();
            });
        });
    });
});<commit_msg>Make the delay longer so that test passes more consistently.<commit_after>define(["pat-masonry"], function(pattern) {

    describe("pat-masonry", function() {
        beforeEach(function() {
            $("<div/>", {id: "lab"}).appendTo(document.body);
        });
        afterEach(function() {
            $("#lab").remove();
        });

        it("Sets class masonry-ready on the element after masonry has finished", function() {
            var $msnry;
            runs(function () {
                $("#lab").html(
                    "<div class='pat-masonry'>" +
                    "  <div class='item'>" +
                    "    <img src='http://i.imgur.com/6Lo8oun.jpg'>"+
                    "  </div>" +
                    "  <div class='item'>" +
                    "    <img src='http://i.imgur.com/HDSAMFl.jpg'>"+
                    "  </div>" +
                    "</div>");
                $msnry = $("#lab .pat-masonry");
                expect($msnry.hasClass("masonry-ready")).toBeFalsy();
                pattern.init($msnry);
            });
            waits(600);
            runs(function () {
                expect($msnry.hasClass("masonry-ready")).toBeTruthy();
            });
        });
    });
});
{'fraction_non_alphanumeric': 0.1890063424947146, 'fraction_numerical': 0.004228329809725159, 'mean_word_length': 1.429158110882957, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '5798179', 'n_tokens_mistral': 716, 'n_tokens_neox': 688, 'n_words': 100}