Backstage
    Preparing search index...
    • Type Parameters

      Parameters

      • subject: ExtensionDefinition<T>
      • Optionaloptions: {
            apis?: readonly [TestApiPairs<TApiPairs>];
            config?: T["configInput"];
            isExpectedError?: (
                error:
                    | {
                        code: "EXTENSION_IGNORED";
                        context: { extensionId: string; plugin: FrontendPlugin };
                        message: string;
                    }
                    | {
                        code: "INVALID_EXTENSION_CONFIG_KEY";
                        context: { extensionId: string };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_INPUT_REDIRECT_CONFLICT";
                        context: { inputName: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_INPUT_DATA_IGNORED";
                        context: { inputName: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_INPUT_DATA_MISSING";
                        context: { inputName: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_INPUT_INTERNAL_IGNORED";
                        context: {
                            extensionId: string;
                            inputName: string;
                            node: AppNode;
                            plugin: FrontendPlugin;
                        };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_ATTACHMENT_CONFLICT";
                        context: { inputName: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_ATTACHMENT_MISSING";
                        context: { inputName: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_CONFIGURATION_INVALID";
                        context: { node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_INVALID";
                        context: { node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_OUTPUT_CONFLICT";
                        context: { dataRefId: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_OUTPUT_MISSING";
                        context: { dataRefId: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_OUTPUT_IGNORED";
                        context: { dataRefId: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_FACTORY_ERROR";
                        context: { node: AppNode };
                        message: string;
                    }
                    | {
                        code: "API_EXTENSION_INVALID";
                        context: { node: AppNode };
                        message: string;
                    }
                    | {
                        code: "API_FACTORY_CONFLICT";
                        context: {
                            apiRefId: string;
                            existingPluginId: string;
                            node: AppNode;
                            pluginId: string;
                        };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_BOOTSTRAP_PREDICATE_IGNORED";
                        context: { node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_BOOTSTRAP_API_UNAVAILABLE";
                        context: { apiRefId: string; node: AppNode };
                        message: string;
                    }
                    | {
                        code: "EXTENSION_BOOTSTRAP_API_OVERRIDE_IGNORED";
                        context: {
                            apiRefId: string;
                            bootstrapNode: AppNode;
                            bootstrapPluginId: string;
                            node: AppNode;
                            pluginId: string;
                        };
                        message: string;
                    }
                    | {
                        code: "FEATURE_FLAG_INVALID";
                        context: { error: Error; flagName: string; pluginId: string };
                        message: string;
                    }
                    | {
                        code: "ROUTE_DUPLICATE";
                        context: { routeId: string };
                        message: string;
                    }
                    | {
                        code: "ROUTE_BINDING_INVALID_VALUE";
                        context: { routeId: string };
                        message: string;
                    }
                    | {
                        code: "ROUTE_NOT_FOUND";
                        context: { routeId: string };
                        message: string;
                    },
            ) => boolean;
        }
        • Optionalapis?: readonly [TestApiPairs<TApiPairs>]
        • Optionalconfig?: T["configInput"]
        • OptionalisExpectedError?: (
              error:
                  | {
                      code: "EXTENSION_IGNORED";
                      context: { extensionId: string; plugin: FrontendPlugin };
                      message: string;
                  }
                  | {
                      code: "INVALID_EXTENSION_CONFIG_KEY";
                      context: { extensionId: string };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_INPUT_REDIRECT_CONFLICT";
                      context: { inputName: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_INPUT_DATA_IGNORED";
                      context: { inputName: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_INPUT_DATA_MISSING";
                      context: { inputName: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_INPUT_INTERNAL_IGNORED";
                      context: {
                          extensionId: string;
                          inputName: string;
                          node: AppNode;
                          plugin: FrontendPlugin;
                      };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_ATTACHMENT_CONFLICT";
                      context: { inputName: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_ATTACHMENT_MISSING";
                      context: { inputName: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_CONFIGURATION_INVALID";
                      context: { node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_INVALID";
                      context: { node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_OUTPUT_CONFLICT";
                      context: { dataRefId: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_OUTPUT_MISSING";
                      context: { dataRefId: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_OUTPUT_IGNORED";
                      context: { dataRefId: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_FACTORY_ERROR";
                      context: { node: AppNode };
                      message: string;
                  }
                  | {
                      code: "API_EXTENSION_INVALID";
                      context: { node: AppNode };
                      message: string;
                  }
                  | {
                      code: "API_FACTORY_CONFLICT";
                      context: {
                          apiRefId: string;
                          existingPluginId: string;
                          node: AppNode;
                          pluginId: string;
                      };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_BOOTSTRAP_PREDICATE_IGNORED";
                      context: { node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_BOOTSTRAP_API_UNAVAILABLE";
                      context: { apiRefId: string; node: AppNode };
                      message: string;
                  }
                  | {
                      code: "EXTENSION_BOOTSTRAP_API_OVERRIDE_IGNORED";
                      context: {
                          apiRefId: string;
                          bootstrapNode: AppNode;
                          bootstrapPluginId: string;
                          node: AppNode;
                          pluginId: string;
                      };
                      message: string;
                  }
                  | {
                      code: "FEATURE_FLAG_INVALID";
                      context: { error: Error; flagName: string; pluginId: string };
                      message: string;
                  }
                  | {
                      code: "ROUTE_DUPLICATE";
                      context: { routeId: string };
                      message: string;
                  }
                  | {
                      code: "ROUTE_BINDING_INVALID_VALUE";
                      context: { routeId: string };
                      message: string;
                  }
                  | {
                      code: "ROUTE_NOT_FOUND";
                      context: { routeId: string };
                      message: string;
                  },
          ) => boolean

          Decides whether an error reported while resolving the extension tree is expected. By default every error fails the test.

      Returns ExtensionTester<NonNullable<T["output"]>>