Skip to content

Running jest tests rendering components created with createText() cause tests to fail with an exceptionΒ #165

@tonyseing

Description

@tonyseing

I'm writing a jest test case that renders a Text component created from the following line of code: export const Text = createText<IotTheme>();

I receive a resulting error:

  TypeError: funcsMap[propKey] is not a function

      at node_modules/@shopify/restyle/dist/composeRestyleFunctions.js:33:137
          at Array.reduce (<anonymous>)
      at Object.buildStyle (node_modules/@shopify/restyle/dist/composeRestyleFunctions.js:33:41)
      at Object.func [as variant] (node_modules/@shopify/restyle/dist/createVariant.js:36:70)
      at node_modules/@shopify/restyle/dist/composeRestyleFunctions.js:33:137
          at Array.reduce (<anonymous>)
      at Object.buildStyle (node_modules/@shopify/restyle/dist/composeRestyleFunctions.js:33:41)
      at node_modules/@shopify/restyle/dist/hooks/useRestyle.js:48:45
      at mountMemo (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6877:19)
      at Object.useMemo (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:7213:16)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions