fs-cache-fast/test/helper.mjs
Jonatan Nilsson dc71c7db05
All checks were successful
/ deploy (push) Successful in 3s
finish implementing version 1.0 and add documentation
2024-09-20 23:14:37 +00:00

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