1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make global override for accessing file system throw to require explicit override

Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>

Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
This commit is contained in:
Janne Savolainen 2022-01-31 11:39:12 +02:00 committed by Sebastian Malton
parent 175add91fc
commit b1c3a59709

View File

@ -33,7 +33,9 @@ export const getDiForUnitTesting = ({ doGeneralOverrides } = { doGeneralOverride
if (doGeneralOverrides) {
di.override(getValueFromRegisteredChannelInjectable, () => () => undefined);
di.override(readDirInjectable, () => () => Promise.resolve([]));
di.override(readDirInjectable, () => () => {
throw new Error("Tried to read contents of a directory from file system without specifying explicit override.");
});
di.override(readFileInjectable, () => () => {
throw new Error("Tried to read a file from file system without specifying explicit override.");