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

Mock process.cwd and process.chdir methods #41

Merged
merged 1 commit into from
Jun 25, 2015
Merged

Mock process.cwd and process.chdir methods #41

merged 1 commit into from
Jun 25, 2015

Conversation

timkendrick
Copy link
Contributor

Hi there - thanks for a great library!

The only problem I had with it was that the process.cwd() and process.chdir() methods still act on the real filesystem, rather than the mock filesystem. This pull request means that these methods get mocked along with the filesystem bindings, ensuring that process is kept in sync with fs.

A couple of points to note:

  • I've tried to match the code style to what's around it, but let me know if there's any formatting/naming/etc conventions that I've missed
  • I'm pretty new to testing so I'm not sure how well I've written the tests

Let me know if this is all ok!

@timkendrick
Copy link
Contributor Author

Did you get a chance to look at this, @tschaub? Let me know if there are any changes I can make.

@tschaub
Copy link
Owner

tschaub commented Jun 25, 2015

This looks very nice @timkendrick. Thanks for the contribution!

tschaub added a commit that referenced this pull request Jun 25, 2015
Mock process.cwd and process.chdir methods.
@tschaub tschaub merged commit 1a11c2a into tschaub:master Jun 25, 2015
@timkendrick
Copy link
Contributor Author

Great, thanks!

@tschaub
Copy link
Owner

tschaub commented Jun 25, 2015

I've published this as mock-fs@3.0.0 (new major since it introduces a potentially breaking change).

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