mapbox / mapbox-upload-validate

Validate that files can be uploaded to mapbox.com
ISC License
5 stars 7 forks source link

Tests fail on Node v6.10.1 #77

Open mapsam opened 7 years ago

mapsam commented 7 years ago

Noticed while releasing https://github.com/mapbox/mapbox-upload-validate/pull/76 that tests are failing within the usage of mock-fs with Node.js version 6.10.1. Version 6.10.0 works just fine, so this appears to be a bug either introduced in Node.js that mock-fs isn't ready for or something else I'm not seeing.

mock-fs tests run just fine with 6.10.1 so maybe it's within mapbox-upload-validate? Unable to tell.

The error:

# lib.validators.omnivore: tif file bigger than default omnivore size is accepted
/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/mock-fs/node/fs-6.3.0.js:469
  var size = st.isFile() ? st.size : 0;
               ^

TypeError: Cannot read property 'isFile' of undefined
    at Object.fs.readFileSync (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/mock-fs/node/fs-6.3.0.js:469:16)
    at Object.readFileSync (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/mock-fs/lib/index.js:60:31)
    at Test.<anonymous> (/Users/mapsam/mapbox/mapbox-upload-validate/test/validators.omnivore.test.js:70:54)
    at Test.bound [as _cb] (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/tape/lib/test.js:62:32)
    at Test.run (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/tape/lib/test.js:75:10)
    at Test.bound [as run] (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/tape/lib/test.js:62:32)
    at Immediate.next (/Users/mapsam/mapbox/mapbox-upload-validate/node_modules/tape/lib/results.js:66:15)
    at runCallback (timers.js:666:20)
    at tryOnImmediate (timers.js:639:5)
    at processImmediate [as _immediateCallback] (timers.js:611:5)

cc @springmeyer @GretaCB

Yugloocamai commented 7 years ago

Having the exact same issue.

Yugloocamai commented 7 years ago

This seems to be fixed in the lastest version of mock-fs (4.3.0)