mirror of
https://github.com/yannbertrand/macos-defaults
synced 2024-12-15 06:02:40 +00:00
062d8b5217
Co-authored-by: Yvonnick FRIN <frin.yvonnick@gmail.com>
15 lines
390 B
JavaScript
15 lines
390 B
JavaScript
const fs = jest.genMockFromModule('fs');
|
|
|
|
const result = {}
|
|
|
|
fs.mkdirSync = jest.fn()
|
|
fs.writeFileSync = jest.fn((path, content) => {
|
|
result[path] = content
|
|
})
|
|
fs.copyFileSync = jest.fn((origin, destination) => {
|
|
result[destination] = `copied:${origin}`
|
|
})
|
|
fs.readFakeFileSync = jest.fn(path => result[path])
|
|
fs.readFileSync = jest.requireActual("fs").readFileSync
|
|
|
|
module.exports = fs
|