Backstage
    Preparing search index...

    Mock implementations of the core utility APIs, to be used in tests.

    There are some variations among the APIs depending on what needs tests might have, but overall there are two main usage patterns:

    1: Creating an actual fake API instance, often with a simplified version of functionality, by calling the mock API itself as a function.

    // The function often accepts parameters that control its behavior
    const foo = mockApis.foo();

    2: Creating a mock API, where all methods are replaced with jest mocks, by calling the API's mock function.

    // You can optionally supply a subset of its methods to implement
    const foo = mockApis.foo.mock({
    someMethod: () => 'mocked result',
    });
    // After exercising your test, you can make assertions on the mock:
    expect(foo.someMethod).toHaveBeenCalledTimes(2);
    expect(foo.otherMethod).toHaveBeenCalledWith(testData);

    Namespaces

    alert
    analytics
    config
    discovery
    error
    featureFlags
    fetch
    identity
    permission
    storage
    translation

    Functions

    alert
    analytics
    config
    discovery
    error
    featureFlags
    fetch
    identity
    permission
    storage
    translation