mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add createReadStream to fake FS
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
e10be8a4f0
commit
69cfe9a25e
@ -32,6 +32,7 @@ const fsInjectable = getInjectable({
|
|||||||
pathExistsSync,
|
pathExistsSync,
|
||||||
pathExists,
|
pathExists,
|
||||||
copy,
|
copy,
|
||||||
|
createReadStream,
|
||||||
} = fse;
|
} = fse;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -52,6 +53,7 @@ const fsInjectable = getInjectable({
|
|||||||
copy: copy as (src: string, dest: string, options?: fse.CopyOptions) => Promise<void>,
|
copy: copy as (src: string, dest: string, options?: fse.CopyOptions) => Promise<void>,
|
||||||
ensureDir: ensureDir as (path: string, options?: number | fse.EnsureOptions ) => Promise<void>,
|
ensureDir: ensureDir as (path: string, options?: number | fse.EnsureOptions ) => Promise<void>,
|
||||||
ensureDirSync,
|
ensureDirSync,
|
||||||
|
createReadStream,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
|
|||||||
@ -60,6 +60,7 @@ export const getOverrideFsWithFakes = () => {
|
|||||||
copy: async (src, dest) => { throw new Error(`Tried to copy '${src}' to '${dest}'. Copying is not yet supported`); },
|
copy: async (src, dest) => { throw new Error(`Tried to copy '${src}' to '${dest}'. Copying is not yet supported`); },
|
||||||
ensureDir: async (path, opts) => ensureDirSync(path, opts),
|
ensureDir: async (path, opts) => ensureDirSync(path, opts),
|
||||||
ensureDirSync,
|
ensureDirSync,
|
||||||
|
createReadStream: root.createReadStream as any,
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user