fs-cache-fast/test/helper.mjs
Jonatan Nilsson 08b2b037ff
All checks were successful
/ deploy (push) Successful in 6s
first version
2024-09-20 13:45:35 +00:00

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