<commit_before>'use strict';
var assert = require('assert');
var callbackify = require('./');

it('should make a sync function pass return to a callback', function () {
	function sum (a, b) { return a + b; }
	var sumCb = callbackify(sum);
	var answer;
	sumCb(32, 96, function (err, result) { answer = result; });
	assert.equal(answer, 128);
});

it('should throw if not given a function', function () {
	assert.throws(function () { callbackify(''); });
});
<commit_msg>Test type checking of wrapped function<commit_after>'use strict';
var assert = require('assert');
var callbackify = require('./');

function sum (a, b) { return a + b; }

it('should make a sync function pass return to a callback', function () {
	var sumCb = callbackify(sum);
	var answer;
	sumCb(32, 96, function (err, result) { answer = result; });
	assert.equal(answer, 128);
});

it('should throw if not given a function', function () {
	assert.throws(function () { callbackify(''); });
});

it('should throw if wrapped function not given a callback', function () {
	var sumCb = callbackify(sum);
	assert.throws(function () { sumCb(32, 96); });
});

{'fraction_non_alphanumeric': 0.1694915254237288, 'fraction_numerical': 0.016057091882247992, 'mean_word_length': 4.813471502590674, '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': '839055', 'n_tokens_mistral': 358, 'n_tokens_neox': 342, 'n_words': 121}