<commit_before>/*global require, module, asyncTest, ok, start*/

(function () {
    "use strict";

    module("Require.js AMD tests");

    asyncTest("flock variable is defined and populated", function () {
        require(["../../../dist/flocking-all.min"], function (flock) {
            ok(flock, "The 'flock' variable should be defined");

            flock.init();
            ok(flock.enviro.shared, "The shared environment can successfully be initialized.");

            var synth = flock.synth({
                synthDef: {
                    ugen: "flock.ugen.impulse"
                }
            });

            ok(synth, "A synth can be correct instantiated.");

            start();
        });
    });

}());
<commit_msg>gh-81: Adds additional test for the synchronous require style.<commit_after>/*global flock, require, module, test, asyncTest, ok, equal, start*/

(function () {
    "use strict";

    var flockingBuildPath = "../../../dist/flocking-all.min";

    module("Require.js AMD tests");

    asyncTest("Flocking is defined and populated using the AMD style", function () {
        require([flockingBuildPath], function (flock) {
            ok(flock, "The 'flock' variable should be defined");

            flock.init();
            ok(flock.enviro.shared, "The shared environment can successfully be initialized.");

            var synth = flock.synth({
                synthDef: {
                    ugen: "flock.ugen.impulse"
                }
            });

            ok(synth, "A synth can be correct instantiated.");

            start();
        });
    });

    test("Flocking is returned synchronously when using a CommonJS-style require.", function () {
        var myFlock = require("../../../dist/flocking-all.min");
        ok(myFlock);
        equal(myFlock, flock,
            "The value returned from a call to require() is the same instance as the browser global.");
    });

}());

{'fraction_non_alphanumeric': 0.13894628099173553, 'fraction_numerical': 0.0010330578512396695, 'mean_word_length': 1.9891975308641976, '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': '5545142', 'n_tokens_mistral': 551, 'n_tokens_neox': 512, 'n_words': 153}