<commit_before>"use strict";

var sira = require('../../../../');

module.exports = function (Car) {
    Car.setupCar = true;

    Car.echo = function (data, cb) {
        cb(null, data);
    };

    Car.order = function (context, cb) {
        var h;
        context.possible.canceled(function cancel() {
            h && clearTimeout(h);
        });

        h = setTimeout(function () {
            cb(null, true);
        }, 500);
    };

    Car.expose('echo', {
        accepts: { name: 'data', source: 'payload' },
        returns: { root: true }
    });

    Car.expose('order', {
        accepts: { name: 'context', source: 'context' },
        returns: { root: true }
    });
};<commit_msg>refactor test<commit_after>"use strict";

var sira = require('../../../../');

module.exports = function (Car) {
    Car.setupCar = true;

    Car.echo = function (data, cb) {
        cb(null, data);
    };

    Car.order = function (future, cb) {
        var h;
        future.canceled(function cancel() {
            h && clearTimeout(h);
        });

        h = setTimeout(function () {
            cb(null, true);
        }, 500);
    };

    Car.expose('echo', {
        accepts: { name: 'data', source: 'payload' },
        returns: { root: true }
    });

    Car.expose('order', {
        accepts: { name: 'future', source: 'future' },
        returns: { root: true }
    });
};
{'fraction_non_alphanumeric': 0.18673395818312905, 'fraction_numerical': 0.004325883201153569, 'mean_word_length': 1.8268839103869654, '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': '5612412', 'n_tokens_mistral': 441, 'n_tokens_neox': 432, 'n_words': 99}