rdy/jasmine-async-suite

Not currently working with native async/await in Node 7.6+

Closed this issue · 3 comments

The issue seems to be that the version of lodash used fails to consider async functions functions. This fails the invariant.

The following fails:

const isFunction = require('lodash.isfunction');

describe('async functions', () => {
  it('should pass isFunction test', () => {
    async function foo() {

    }

    expect(isFunction(foo)).toBeTruthy();
  });
});

However, the latest full lodash package does work, as the following passes:

const isFunction = require('lodash/isfunction');

describe('async functions', () => {
  it('should pass isFunction test', () => {
    async function foo() {

    }

    expect(isFunction(foo)).toBeTruthy();
  });
});
rdy commented

Hmm I can publish a new version with it updated. I wonder if I should just use typeof, the Lodash one was to fix an old bug in early chrome.

rdy commented

i tried switching it to a typeof check which is different from what lodash uses, in my version of node i don't get a failure, so let me know if the new version that just uses typeof works for you.

Sounds good. I'm on vacation this weekend without a laptop, so I may not get to try it out for a few days, but I'm thinking it will work fine. Thanks for the update!