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

Throw error if item content is invalid #218

Closed
wants to merge 1 commit into from
Closed

Throw error if item content is invalid #218

wants to merge 1 commit into from

Conversation

mutantcornholio
Copy link
Contributor

I've wasted some time trying to understand root cause of random EBADF's in my tests.
Like this:

Error: EBADF, bad file descriptor
    at Binding.<anonymous> (/Users/cornholio/dev/veendor/node_modules/mock-fs/lib/binding.js:463:13)
    at maybeCallback (/Users/cornholio/dev/veendor/node_modules/mock-fs/lib/binding.js:30:18)
    at Binding.read (/Users/cornholio/dev/veendor/node_modules/mock-fs/lib/binding.js:455:10)
    at ReadFileContext.read (fs.js:342:11)
    at FSReqWrap.readFileAfterStat [as oncomplete] (fs.js:387:13)
    at /Users/cornholio/dev/veendor/node_modules/mock-fs/lib/binding.js:75:16
    at /Users/cornholio/dev/veendor/node_modules/mock-fs/lib/binding.js:38:9
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

And was surprised finding that I was reading file, which contents were set to undefined in config.

After this PR, I get error on calling mockfs:

Error: Unsupported type: undefined of item package.json
    at populate (node_modules/mock-fs/lib/filesystem.js:148:15)
    at Function.FileSystem.create (node_modules/mock-fs/lib/filesystem.js:192:9)
    at mock (node_modules/mock-fs/lib/index.js:59:27)
    at Context.beforeEach (test/unit/install.test.js:41:9)

@mutantcornholio
Copy link
Contributor Author

@tschaub what do you think of this?

@mutantcornholio
Copy link
Contributor Author

@tschaub ping?

@mutantcornholio
Copy link
Contributor Author

@tschaub ?

@tschaub
Copy link
Owner

tschaub commented Oct 13, 2017

This looks good @mutantcornholio. I'll make an update to get the tests passing and then pull this in.

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 this pull request may close these issues.

2 participants