<commit_before>var directory = "Sounds",
    fileTypes = ["mp3"],
    library = {
        "General": ["Test"],
        "Themes": ["Theme"]
    },
    statistics = {
        "prefix": "MyAudioPlayr::",
        "values": {
            "volume": {},
            "muted": {}
        }
    },
    AudioPlayer, insides;

describe("constructor", function () {
    it("requires library, directory, and fileTypes", function () {
        chai.expect(function () {
            new AudioPlayr({
                "directory": directory,
                "fileTypes": fileTypes,
                "statistics": statistics
            });
        }).to.throw("No library given to AudioPlayr.");

        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "fileTypes": fileTypes,
                "statistics": statistics
            });
        }).to.throw("No directory given to AudioPlayr.");

        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "statistics": statistics
            });
        }).to.throw("No fileTypes given to AudioPlayr.");
    });

    it("ensures the internal StatsHoldr has volume and muted", function () {
        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "fileTypes": fileTypes
            });
        }).to.throw("No statistics with values given to AudioPlayr.");
        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "fileTypes": fileTypes,
                "statistics": {
                    "values": {}
                }
            });
        }).to.throw("Statistics given to AudioPlayr must include volume and muted.");
    });

    it("starts creating the library", function () {
        AudioPlayer = new AudioPlayr({
            "library": library,
            "directory": directory,
            "fileTypes": fileTypes,
            "statistics": statistics
        });

        insides = AudioPlayer.getLibrary();

        chai.expect(Object.keys(insides)).to.be.length(4);
        chai.expect(insides.Theme.tagName).to.be.equal("AUDIO");
        chai.expect(insides.Test.tagName).to.be.equal("AUDIO");
    });
});<commit_msg>Started "play" unit tests<commit_after>var directory = "Sounds",
    fileTypes = ["mp3"],
    library = {
        "General": ["Test"],
        "Themes": ["Theme"]
    },
    statistics = {
        "prefix": "MyAudioPlayr::",
        "values": {
            "volume": {},
            "muted": {}
        }
    },
    AudioPlayer, insides;

describe("constructor", function () {
    it("requires library, directory, and fileTypes", function () {
        chai.expect(function () {
            new AudioPlayr({
                "directory": directory,
                "fileTypes": fileTypes,
                "statistics": statistics
            });
        }).to.throw("No library given to AudioPlayr.");

        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "fileTypes": fileTypes,
                "statistics": statistics
            });
        }).to.throw("No directory given to AudioPlayr.");

        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "statistics": statistics
            });
        }).to.throw("No fileTypes given to AudioPlayr.");
    });

    it("ensures the internal StatsHoldr has volume and muted", function () {
        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "fileTypes": fileTypes
            });
        }).to.throw("No statistics with values given to AudioPlayr.");
        chai.expect(function () {
            new AudioPlayr({
                "library": library,
                "directory": directory,
                "fileTypes": fileTypes,
                "statistics": {
                    "values": {}
                }
            });
        }).to.throw("Statistics given to AudioPlayr must include volume and muted.");
    });

    it("starts creating the library", function () {
        AudioPlayer = new AudioPlayr({
            "library": library,
            "directory": directory,
            "fileTypes": fileTypes,
            "statistics": statistics
        });

        insides = AudioPlayer.getLibrary();

        chai.expect(Object.keys(insides)).to.be.length(4);
        chai.expect(insides.Theme.tagName).to.be.equal("AUDIO");
        chai.expect(insides.Test.tagName).to.be.equal("AUDIO");
    });
});

describe("play", function () {
    it("throws an error for invalid requests", function () {
        chai.expect(function () {
            AudioPlayer.play("nope")
        }).to.throw("Unknown name given to AudioPlayr.play: 'nope'.");
    });
});
{'fraction_non_alphanumeric': 0.14052351899232435, 'fraction_numerical': 0.000787246604999016, 'mean_word_length': 1.6496350364963503, 'pattern_counts': {'":': 54, '<': 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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5060952', 'n_tokens_mistral': 1340, 'n_tokens_neox': 1282, 'n_words': 288}