Skip to content

mock-fs 4.3.0 broken on node 8 #208

Closed

Description

@AGrzes

I'm using mock-fs in my tests and they fail on node 8.
I ran the module test suite and there is a lot of errors.
Attached the test log mock-fs@node8-test.txt

Activity

  1. AGrzes commented on Jun 5, 2017

    @AGrzes
    ContributorAuthor

    It looks like node 8 is throwing away the values provided to callback by mock-fs.

    // Special case of `makeCallback()` that is specific to async `*stat()` calls as
    // an optimization, since the data passed back to the callback needs to be
    // transformed anyway.
    function makeStatsCallback(cb) {
      if (cb === undefined) {
        return rethrow();
      }
    
      if (typeof cb !== 'function') {
        throw new TypeError('"callback" argument must be a function');
      }
    
      return function(err) {
        if (err) return cb(err);
        cb(err, statsFromValues());
      };
    }
    

    https://github.com/nodejs/node/blob/v8.0.0/lib/fs.js#L139-L155

  2. AGrzes commented on Jun 5, 2017

    @AGrzes
    ContributorAuthor

    Related issue #197 and PR nodejs/node#11665

  3. AGrzes commented on Jun 5, 2017

    @AGrzes
    ContributorAuthor

    Started work in #209

  4. tschaub commented on Jun 11, 2017

    @tschaub
    Owner

    Fix published in mock-fs@4.4. Thanks @AGrzes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions