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

net.createServer still uses real file system #370

Open
TheDirigible opened this issue Dec 20, 2022 · 2 comments
Open

net.createServer still uses real file system #370

TheDirigible opened this issue Dec 20, 2022 · 2 comments

Comments

@TheDirigible
Copy link

When using net.createServer to create a unix domain socket (socket file), it is created in the real file system, even though mock-fs was used. Is there any fix for this?

@3cp
Copy link
Collaborator

3cp commented Dec 20, 2022

mock-fs is not an implementation of file system, it only works in nodejs context by monkey patching some methods. Socket file is probably out of reach.

For your use case, you can try to use a real file system like tmpfs to create a transient file system in ram.

@3cp
Copy link
Collaborator

3cp commented Dec 20, 2022

Yes, besides normal file and directory, mock-fs only has symlink.

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

No branches or pull requests

2 participants