https://www.npmjs.com/package/mock-fs We just mock the fs before the action function is run, and re-set after. Not sure if there will be concurrency issues