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 SavolainenandMikko Aspiala authored and Sebastian Malton committed 2022-01-31 09:10:23 -05:00
1 parent 175add91fc
commit b1c3a59709
1 file changed
+3 -1
+3 -1
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.");