Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for async functions? (Node 8) #284

Closed
Fr8Traindb opened this issue Sep 7, 2017 · 4 comments · Fixed by #285
Closed

Missing support for async functions? (Node 8) #284

Fr8Traindb opened this issue Sep 7, 2017 · 4 comments · Fixed by #285

Comments

@Fr8Traindb
Copy link

Fr8Traindb commented Sep 7, 2017

td.replace and td.object do not seem to handle Node 8 async functions.

Example:

var fish = {
    eat: async function () { },
    swim: function () { },
    details: {
      age: 10,
      name: 'goldie'
    }
  };
  var fish = td.object(fish);

results of fish:
{ eat: {},
swim: { [Function: testDouble] toString: [Function] },
details: { age: 10, name: 'goldie' },
toString: [Function] }

The async function eat is not a testDouble function - it gets replaced with a empty object. I get the same results using td.replace().

@searls
Copy link
Member

searls commented Sep 7, 2017

We haven't looked at this yet, and they are not yet supported

@rosston
Copy link
Member

rosston commented Sep 7, 2017

@Fr8Traindb If you run npm ls lodash in your project, does it show something <4.17.0 under testdouble? I've tested td.object running on top of lodash >= 4.17.4, and async functions get detected properly.

@Fr8Traindb
Copy link
Author

@rosston I can hardly believe that did it! Upgraded to lodash 4.17.4 and all is good indeed! I was on 4.16.2

@searls
Copy link
Member

searls commented Sep 7, 2017

landed in 3.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants