fs-cache-fast/test/helper.mjs

24 lines
373 B
JavaScript
Raw Normal View History

2024-09-20 13:40:01 +00:00
import { spy } from 'eltro'
export function fakeFsSync() {
return {
mkdirSync: spy(),
readFileSync: spy(),
writeFileSync: spy(),
}
}
export function fakeFsPromises() {
return {
readFile: spy().resolves(),
writeFile: spy().resolves(),
}
}
export function fakeFs() {
return {
fsSync: fakeFsSync(),
fsPromises: fakeFsPromises(),
}
}