Skip to content

Error when using mock-fs #374

Open
Open
@lyqht

Description

@lyqht

I'm getting an error when using Node version v18.14.2, and trying to test a code that uses fs.readFile,fs.readFileSync, fs.existsSync, fs.writeFileSync, fs.writeFile

The error

(node:72471) Warning: File descriptor 5 closed but not opened in unmanaged mode
(Use `node --trace-warnings ...` to show where the warning was created)
stdout | unknown test
[Error: EBADF: bad file descriptor, read] {
  errno: -9,
  code: 'EBADF',
  syscall: 'read'
}

I don't quite understand the error, how do I fix this?

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