Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix jest in TestApp #314

Merged
merged 6 commits into from
May 23, 2018
Merged

Fix jest in TestApp #314

merged 6 commits into from
May 23, 2018

Conversation

MatkovIvan
Copy link
Contributor

No description provided.

@dhei
Copy link
Member

dhei commented May 17, 2018

@MatkovIvan, eslint is not happy with mocks in __mocks__ thus failing Build, please fix it. Please fix DemoApp as well.

@guperrot
Copy link
Member

@MatkovIvan Let's wait #303 to do that and have test app point at mock files provided by SDK.

@@ -0,0 +1,9 @@
const Crashes = jest.mock('appcenter-crashes');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please catch up with develop and remove those. Might need to revisit the PR entirely now that #303 is merged.

Copy link
Member

@guperrot guperrot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have the following errors when running npm run test after running ./update-npm-packages.sh on this branch:

npm run test

> [email protected] test /Users/guperrot/git/appcenter-sdk-react-native/TestApp
> jest


 RUNS  __tests__/index.ios.js
 RUNS  __tests__/index.android.js

Test Suites: 0 of 2 total
Tests:       0 total
Snapshots:   0 total
  console.error node_modules/react-native/Libraries/ReactNative/YellowBox.js:73
    The above error occurred in the <AnimatedComponent> component:
        in AnimatedComponent (created by Card)
        in Card (created by Container)
        in Container (created by CardStack)
        in View (created by Component)
        in Component (created by CardStack)
        in View (created by Component)
        in Component (created by CardStack)
        in CardStack (created by Transitioner)
        in View (created by Component)
        in Component (created by Transitioner)
        in Transitioner (created by CardStackTransitioner)
        in CardStackTransitioner
        in Unknown (created by Navigator)
        in Navigator (created by NavigationContainer)
        in NavigationContainer
    
    Consider adding an error boundary to your tree to customize error handling behavior.
    Visit https://fb.me/react-error-boundaries to learn more about error boundaries.

  console.error node_modules/react-native/Libraries/ReactNative/YellowBox.js:73
    The above error occurred in the <AnimatedComponent> component:
        in AnimatedComponent (created by Card)
        in Card (created by Container)
        in Container (created by CardStack)
        in View (created by Component)
        in Component (created by CardStack)
        in View (created by Component)
        in Component (created by CardStack)
        in CardStack (created by Transitioner)
        in View (created by Component)
        in Component (created by Transitioner)
        in Transitioner (created by CardStackTransitioner)
        in CardStackTransitioner
 FAIL  __tests__/index.android.js (16.119s)
  ✕ renders correctly (218ms)

  ● renders correctly

    TypeError: Cannot read property '__getValue' of undefined
      
      at AnimatedComponent.render (node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js:154:9)
      at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3666:31)
      at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3643:12)
      at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:4017:16)
      at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6008:16)
      at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6072:26)
      at Object.invokeGuardedCallback$1 (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:1553:10)
      at invokeGuardedCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:1500:29)
      at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6150:7)
      at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6764:24)

 FAIL  __tests__/index.ios.js (16.134s)
  ✕ renders correctly (258ms)

  ● renders correctly

    TypeError: Cannot read property '__getValue' of undefined
      
      at AnimatedComponent.render (node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js:154:9)
      at finishClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3666:31)
      at updateClassComponent (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:3643:12)
      at beginWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:4017:16)
      at performUnitOfWork (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6008:16)
      at workLoop (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6072:26)
      at Object.invokeGuardedCallback$1 (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:1553:10)
      at invokeGuardedCallback (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:1500:29)
      at renderRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6150:7)
      at performWorkOnRoot (node_modules/react-test-renderer/cjs/react-test-renderer.development.js:6764:24)

Test Suites: 2 failed, 2 total
Tests:       2 failed, 2 total
Snapshots:   0 total
Time:        18.567s

@guperrot guperrot merged commit 9f42dd6 into develop May 23, 2018
@guperrot guperrot deleted the fix/testapp-jest branch May 23, 2018 18:58
@guperrot guperrot restored the fix/testapp-jest branch May 23, 2018 19:15
@guperrot guperrot deleted the fix/testapp-jest branch May 23, 2018 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants