MockConfigApi is a thin wrapper around @backstage/config#ConfigReader that can be used to mock configuration using a plain object.
const mockConfig = new MockConfigApi({ data: { app: { baseUrl: 'https://example.com' } },});const rendered = await renderInTestApp( <TestApiProvider apis={[[configApiRef, mockConfig]]}> <MyTestedComponent /> </TestApiProvider>,); Copy
const mockConfig = new MockConfigApi({ data: { app: { baseUrl: 'https://example.com' } },});const rendered = await renderInTestApp( <TestApiProvider apis={[[configApiRef, mockConfig]]}> <MyTestedComponent /> </TestApiProvider>,);
Optional
MockConfigApi is a thin wrapper around @backstage/config#ConfigReader that can be used to mock configuration using a plain object.
Example