<commit_before>var assert = require('assert');

var async = require('async');
var funkit = require('funkit');
var equals = funkit.ops.equals;
var is = require('is-js');


var log = console.log.bind(console);
var models;
var sugar;

function spec(s, engine) {
    sugar = s;
    models = require('./models')(s, engine);

    log('Executing tests!');

    async.series(setup([
        createAuthor(),
        updateAuthor,
        removeAuthor,
        removeAuthorByName,
        removeCascade,
        getOrCreateAuthor,
        getAuthor,
        getAuthorName,
        getAllAuthors,
        getAllAuthorsLimit,
        getAllAuthorsOffset,
        getAllAuthorNames,
        getOneAuthor,
        getMeta,
        createMiddleware
    ], removeData
    ), function() {
        log('Tests executed!');

        process.exit();
    });
}
module.exports = spec;

function removeData(t) {
    return function(cb) {
        async.series([
            removeAuthors,
            removeLibraries,
            removeLibraryAuthors
        ], t.bind(undefined, cb));
    };
}

function setup(tests, fn) {
    return tests.map(function(t) {
        return fn(t);
    });
}

// TODO: figure out why bind doesn't work for these!
function removeAuthors(cb) {
    removeAll(models.Author, cb);
}<commit_msg>Print out the name of the test being executed<commit_after>var assert = require('assert');

var async = require('async');
var funkit = require('funkit');
var equals = funkit.ops.equals;
var is = require('is-js');


var log = console.log.bind(console);
var models;
var sugar;

function spec(s, engine) {
    sugar = s;
    models = require('./models')(s, engine);

    log('Executing tests!');

    async.series(setup([
        createAuthor(),
        updateAuthor,
        removeAuthor,
        removeAuthorByName,
        removeCascade,
        getOrCreateAuthor,
        getAuthor,
        getAuthorName,
        getAllAuthors,
        getAllAuthorsLimit,
        getAllAuthorsOffset,
        getAllAuthorNames,
        getOneAuthor,
        getMeta,
        createMiddleware
    ], removeData
    ), function() {
        log('Tests executed!');

        process.exit();
    });
}
module.exports = spec;

function removeData(t) {
    return function(cb) {
        async.series([
            removeAuthors,
            removeLibraries,
            removeLibraryAuthors
        ], t.bind(undefined, cb));
    };
}

function setup(tests, fn) {
    return tests.map(function(t) {
        return function() {
            console.log('Executing ', fn.name);

            fn(t);
        };
    });
}

// TODO: figure out why bind doesn't work for these!
function removeAuthors(cb) {
    removeAll(models.Author, cb);
}
{'fraction_non_alphanumeric': 0.12218530823181986, 'fraction_numerical': 0.0, 'mean_word_length': 2.3374384236453203, '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': '4640968', 'n_tokens_mistral': 795, 'n_tokens_neox': 776, 'n_words': 181}