Chai: assert.isFunction fails when passing an async function

Created on 12 Apr 2017  路  5Comments  路  Source: chaijs/chai

Code:

async function a() { }
console.log(typeof a);
console.log(a instanceof Function);
assert.isFunction(a);

Result:

function
true

AssertionError: expected [Function: a] to be a function
    at Function.assert.isFunction (node_modules/chai/lib/chai/interface/assert.js:516:35)
    at Context.it (test/CoreTest.js:87:11)

Most helpful comment

Not working with 4.2.0 as well

All 5 comments

@atheros thanks for the issue. What version of chai are you using? Could you try installing npm i chai@canary and see if the problem persists.

@keithamus thanks for quick response. Issue is present in chai 3.5.0. Tested with node 7.7.4.

chai@canary doesn't have this problem, I guess I'll switch to this version.

@atheros FWIW we plan to have chai@4 released by end of April. canary is relatively battle tested.

Not working with 4.2.0 as well

Having the same problem with "chai": "^4.0.0-canary.2",

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qbolec picture qbolec  路  5Comments

corybill picture corybill  路  4Comments

liborbus picture liborbus  路  4Comments

JuHwon picture JuHwon  路  5Comments

xareelee picture xareelee  路  3Comments