Function create

  • Creates engine for unit-testing of react component

    Type Parameters

    • Props

    • Queries extends Record<string, ComponentType<any> | keyof IntrinsicElements>

    • Callbacks extends Record<string, [keyof Queries & string, string]>

    • Properties extends Record<string, [keyof Queries, string]>

    • Hooks extends Record<string, ((...args) => any)>

    Parameters

    • Component: ComponentType<Props>

      target component

    • defaultProps: Props

      stubs for required props

    • options: OptionsType<Queries, Callbacks, Properties, Hooks>

      named accessors for rendered components and their props and callbacks

    Returns ((props, hookValues?) => EngineType<Queries, Callbacks, Properties, Hooks>)

    function that renders components and initializes accessors

      • (props, hookValues?): EngineType<Queries, Callbacks, Properties, Hooks>
      • function that renders components and initializes accessors

        Parameters

        • props: Partial<Props>

          props of target component

        • hookValues: Partial<{
              [Key in string | number | symbol]: ReturnType<Hooks[Key]>
          }> = {}

          values of hooks

        Returns EngineType<Queries, Callbacks, Properties, Hooks>

        engine for unit-testing

Generated using TypeDoc