Skip to content

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

@alexborton

Description

@alexborton

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions