UNPKG

prisma

Version:

Prisma is an open-source database toolkit. It includes a JavaScript/TypeScript ORM for Node.js, migrations and a modern GUI to view and edit the data in your database. You can use Prisma in new projects or add it to an existing one.

15 lines (11 loc) 320 B
const { patchFs } = require('fs-monkey') const fs = require('fs') module.exports = function mockFs(fileMap) { const originalFsRead = fs.readFileSync const myFs = { readFileSync: (fileName, ...args) => { return fileMap[fileName] || originalFsRead.call(fs, fileName, ...args) }, } patchFs(myFs) }