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

emptyDir throws Error if no callback is provided #135

Closed
deyhle opened this issue May 19, 2015 · 3 comments
Closed

emptyDir throws Error if no callback is provided #135

deyhle opened this issue May 19, 2015 · 3 comments

Comments

@deyhle
Copy link

deyhle commented May 19, 2015

I use emptyDir(…) in a mocha after hook to delete files generated by my test cases:

  after('remove compiled files', function() {
    fs.emptyDir('./build');
  });

This throws the following error in node's fs (?) if no callback argument is provided:

TypeError: undefined is not a function
    at FSReqWrap.oncomplete (fs.js:95:15)

If I provide an empty function as callback, all is fine:

  after('remove compiled files', function() {
    fs.emptyDir('./build', function(){});
  });

I'm on Node v0.12.2.

@jprichardson
Copy link
Owner

This definitely shouldn't throw an error if no callback is provided, but why don't you just do this in meantime?

after('remove compiled files', function(done) {
  fs.emptyDir('./build', done);
});

@jprichardson jprichardson modified the milestone: 1.0 Jul 2, 2015
@RyanZim
Copy link
Collaborator

RyanZim commented Oct 27, 2016

@deyhle I can't reproduce, perhaps this has been fixed?

@RyanZim
Copy link
Collaborator

RyanZim commented Nov 5, 2016

Going to assume this is fixed. Closing.

@RyanZim RyanZim closed this as completed Nov 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants