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

Abierto
#165 8 comentarios 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
react-native, typescript

Línea de trabajo

Start with the Jest test that renders the Text component created by createText(). Trace the failure through composeRestyleFunctions.js, createVariant.js, and useRestyle.js using the provided stack trace. Done means the component renders in the Jest test without the funcsMap[propKey] exception.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

needs-reproduction

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)
Lenguaje dominante
TypeScript
Estrellas
3.4k
Forks
154
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Shopify/restyle

Todos los issues de Shopify/restyle

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.