fs-cache-fast/test/helper.mjs

23 lines
373 B
JavaScript

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(),
}
}