Skip to content

Commit

Permalink
Remove .is{FunctionType} assert interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
koddsson committed Jan 21, 2024
1 parent 937b1c5 commit 2b325e8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 73 deletions.
32 changes: 0 additions & 32 deletions lib/chai/interface/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -589,38 +589,6 @@ assert.isNotCallable = function (val, msg) {
new Assertion(val, msg, assert.isNotCallable, true).is.not.callable;
};

/**
* ### .isAsyncFunction(value, [message])
*
* Asserts that `value` is an async function.
*
* async function serveTea() { return 'cup of tea'; };
* assert.isAsyncFunction(serveTea, 'great, we can have tea now');
*
* @name isAsyncFunction
* @param {Mixed} value
* @param {String} message
* @namespace Assert
* @api public
*/
assert.isAsyncFunction = function (val, msg) {
new Assertion(val, msg, assert.isAsyncFunction, true).is.a('asyncFunction');
};

/**
* TODO
*/
assert.isGeneratorFunction = function(val, msg) {
new Assertion(val, msg, assert.isGeneratorFunction, true).is.a('generatorFunction');
}

/**
* TODO
*/
assert.isAsyncGeneratorFunction = function(val, msg) {
new Assertion(val, msg, assert.isAsyncGeneratorFunction, true).is.a('asyncGeneratorFunction');
}

/**
* ### .isObject(value, [message])
*
Expand Down
41 changes: 0 additions & 41 deletions test/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -548,47 +548,6 @@ describe('assert', function () {
}, "blah: expected {} to be a callable function");
});

it('isAsyncFunction', function() {
var func = async function() {};
assert.isAsyncFunction(func);

var func = async function*() {};
assert.isAsyncFunction(func);

err(function () {
assert.isAsyncFunction(function() {}, 'blah');
}, "blah: expected [Function] to be an asyncfunction");
});

it('isGeneratorFunction', function() {
var func = function* () {}
assert.isGeneratorFunction(func)

var func = async function* () {}
assert.isGeneratorFunction(func)

err(function () {
assert.isGeneratorFunction(function() {}, 'blah');
}, "blah: expected [Function] to be a generatorfunction");
})

it('isAsyncGeneratorFunction', function() {
var func = async function* () {}
assert.isAsyncGeneratorFunction(func)

err(function () {
assert.isAsyncGeneratorFunction(function() {}, 'blah');
}, "blah: expected [Function] to be an asyncgeneratorfunction");

err(function () {
assert.isAsyncGeneratorFunction(async function() {}, 'blah');
}, "blah: expected [AsyncFunction] to be an asyncgeneratorfunction");

err(function () {
assert.isAsyncGeneratorFunction(function*() {}, 'blah');
}, "blah: expected [GeneratorFunction] to be an asyncgeneratorfunction");
})

it('isNotFunction', function () {
assert.isNotFunction(5);

Expand Down

0 comments on commit 2b325e8

Please sign in to comment.