Now that I'm testing my app using I find out it would be helpful to have a fake translation loader that just returns an empty object.
With this loader we can guarantee that the translation is the provided key.
Its very easy too:
export class TranslationLoaderFake extends TranslationLoader {
public load(): Promise<object> {
return Promise.resolve({});
}
}
We could also move the flattenTranslations method to the abstract class TranslationLoader and make it protected. This way the TranslationLoaderFake can use this method too what gives a nice difference too:
Now that I'm testing my app using I find out it would be helpful to have a fake translation loader that just returns an empty object.
With this loader we can guarantee that the translation is the provided key.
Its very easy too:
We could also move the
flattenTranslations
method to the abstract classTranslationLoader
and make it protected. This way theTranslationLoaderFake
can use this method too what gives a nice difference too: