27 lines
475 B
JavaScript
27 lines
475 B
JavaScript
import { spy } from 'eltro'
|
|
|
|
export function fakeFsSync() {
|
|
return {
|
|
mkdirSync: spy(),
|
|
readFileSync: spy(),
|
|
writeFileSync: spy(),
|
|
rmSync: spy(),
|
|
readdirSync: spy(),
|
|
}
|
|
}
|
|
|
|
export function fakeFsPromises() {
|
|
return {
|
|
readFile: spy().resolves(),
|
|
writeFile: spy().resolves(),
|
|
rm: spy().resolves(),
|
|
readdir: spy().resolves([]),
|
|
}
|
|
}
|
|
|
|
export function fakeFs() {
|
|
return {
|
|
fsSync: fakeFsSync(),
|
|
fsPromises: fakeFsPromises(),
|
|
}
|
|
}
|