one more test

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2023-12-14 10:44:43 +01:00
parent 44735df633
commit 8f5b7a0a62
@@ -126,6 +126,25 @@ describe('createApp', () => {
).resolves.toBeInTheDocument();
});
it('should propagate errors thrown by feature loaders', async () => {
const app = createApp({
configLoader: async () => ({
config: new MockConfigApi({}),
}),
features: [
async () => {
throw new TypeError('boom');
},
],
});
await expect(
renderWithEffects(app.createRoot()),
).rejects.toThrowErrorMatchingInlineSnapshot(
`"Failed to read frontend features from loader, TypeError: boom"`,
);
});
it('should register feature flags', async () => {
const app = createApp({
configLoader: async () => ({ config: new MockConfigApi({}) }),