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

Đang mở
#165 8 bình luận 2 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
react-native, typescript
Lĩnh vực
mobile-dev, testing

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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)
Ngôn ngữ chính
TypeScript
Star
3.4k
Fork
154
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Shopify/restyle

Tất cả issue của Shopify/restyle

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.