<commit_before>var buster = require("buster");
var amd = require("../lib/buster-amd");
var c = require("../../buster-configuration");

function withGroup(body, tests) {
    var group, rs, err, data, loadedTests;
    var instance = tests(
	function() { return group; },
	function() { return rs; },
	function() { return err; },
	function() { return data; },
	function() { return loadedTests; }
    );

    instance.setUp = function (done) {
        body.extensions = [{ name: "buster-amd", extension: amd }];
	group = c.create().addGroup("test", body, __dirname + "/fixtures");

        group.bundleFramework().resolve().then(function (resourceSet) {
	    rs = resourceSet;
            var paths = resourceSet.loadPath.paths();
	    loadedTests = paths.filter(function (p) { return p.indexOf("/buster") !== 0; });
            rs.get("/buster/load-all.js").content().then(done(function (content) {
                data = content;
            }));
	});
    };

    return instance;
};

buster.testCase("AMD extension", {
    "configuration": {
	"empty group" : withGroup({}, function(group, rs, err, content) {
	    return {<commit_msg>Update test after API change<commit_after>var buster = require("buster");
var amd = require("../lib/buster-amd");
var c = require("../../buster-configuration");

function withGroup(body, tests) {
    var group, rs, err, data, loadedTests;
    var instance = tests(
	function() { return group; },
	function() { return rs; },
	function() { return err; },
	function() { return data; },
	function() { return loadedTests; }
    );

    instance.setUp = function (done) {
        body.extensions = [amd];
	group = c.create().addGroup("test", body, __dirname + "/fixtures");

        group.bundleFramework().resolve().then(function (resourceSet) {
	    rs = resourceSet;
            var paths = resourceSet.loadPath.paths();
	    loadedTests = paths.filter(function (p) { return p.indexOf("/buster") !== 0; });
            rs.get("/buster/load-all.js").content().then(done(function (content) {
                data = content;
            }));
	});
    };

    return instance;
};

buster.testCase("AMD extension", {
    "configuration": {
	"empty group" : withGroup({}, function(group, rs, err, content) {
	    return {
{'fraction_non_alphanumeric': 0.17736185383244207, 'fraction_numerical': 0.00089126559714795, 'mean_word_length': 3.059674502712477, 'pattern_counts': {'":': 2, '<': 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': '6852518', 'n_tokens_mistral': 681, 'n_tokens_neox': 664, 'n_words': 159}