[BUG] TypeError: Object.defineProperty called on non-object

オープン
#528 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
32/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
react-native, typescript

調査の方向性

まず app/screens/Authentication/LoginScreen/tests/LoginScreen.perf-test.tsx のパフォーマンステストを実行し、reassure から @callstack/reassure-measure への import chain をたどってください。node_modules 内の mathjs の stack frame、特に Complex.js と factory.js を調べ、セットアップが失敗する理由を特定してください。CLI から表示されたテストが正常に実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug

I've stepped through the (very simple) setup instructions, with a view to add a POC to our project, but i'm met with the following error when the test runs;

app/screens/Authentication/LoginScreen/__tests__/LoginScreen.perf-test.tsx
  ● Test suite failed to run

    TypeError: Object.defineProperty called on non-object
        at Function.defineProperty (<anonymous>)

    > 1 | import { measureRenders } from 'reassure'
        | ^
      2 |
      3 | import LoginScreen from '../LoginScreen'
      4 |

      at defineProperty (node_modules/mathjs/lib/cjs/type/complex/Complex.js:19:10)
      at create (node_modules/mathjs/lib/cjs/utils/factory.js:45:12)
      at Object.<anonymous> (node_modules/mathjs/lib/cjs/entry/pureFunctionsAny.generated.js:20:84)
      at Object.require (node_modules/mathjs/lib/cjs/entry/mainAny.js:51:34)
      at Object.require (node_modules/mathjs/lib/cjs/index.js:6:16)
      at Object.require (node_modules/@callstack/reassure-measure/src/measure-helpers.tsx:1:1)
      at Object.require (node_modules/@callstack/reassure-measure/src/measure-renders.tsx:4:1)
      at Object.require (node_modules/@callstack/reassure-measure/src/index.ts:2:1)
      at Object.require (node_modules/reassure/src/index.ts:1:1)
      at Object.require (app/screens/Authentication/LoginScreen/__tests__/LoginScreen.perf-test.tsx:1:1)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:3:24)
      at asyncGeneratorStep (node_modules/@babel/runtime/helpers/asyncToGenerator.js:22:9)

The test simply looks like;

import { measureRenders } from 'reassure'

import LoginScreen from '../LoginScreen'

test('Simple test', async () => {
  await measureRenders(<LoginScreen />)
})

To Reproduce
Steps to reproduce the behavior:

  1. followed the setup instructions but installing reassure
  2. Jest already setup and functional with @testing-library/react-native

Expected behavior
Tests should run in cli

主要言語
TypeScript
スター
1.5k
フォーク
39
平均マージ
3時間 48分
マージ済み PR(30日)
2

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

callstack/reassure のほかの issue

callstack/reassure の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。