MockConfigApi
Home > @backstage/test-utils
> MockConfigApi
MockConfigApi is a thin wrapper around ConfigReader that can be used to mock configuration using a plain object.
Signature:
class MockConfigApi implements ConfigApi
Implements: ConfigApi
Example
const mockConfig = new MockConfigApi({
app: { baseUrl: 'https://example.com' },
});
const rendered = await renderInTestApp(
<TestApiProvider apis={[[configApiRef, mockConfig]]}>
<MyTestedComponent />
</TestApiProvider>,
);
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(data) | Constructs a new instance of the MockConfigApi class |