A simple way how to use memfs with Jest for testing filesystem: https://github.com/sapegin/mrm-core/blob/master/__mocks__/fs.js
memfs