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

The react-es6 example failing with No 'render' method #320

Closed
carlomahfouz opened this issue Apr 3, 2015 · 2 comments
Closed

The react-es6 example failing with No 'render' method #320

carlomahfouz opened this issue Apr 3, 2015 · 2 comments

Comments

@carlomahfouz
Copy link

Trying to run the react-es6 example and getting this error :

Using Jest CLI v0.4.0
 FAIL  __tests__/CheckboxWithLabel-test.js (1.594s)
Warning: CheckboxWithLabel(...): No `render` method found on the returned component instance: you may have forgotten to define `render` in your component or you may have accidentally tried to render an element whose type is a function that isn't a React component.
● CheckboxWithLabel › it changes the text after click
  - TypeError: Object [object Object] has no method 'render'
        at ReactCompositeComponentMixin._renderValidatedComponentWithoutOwnerOrContext (/.../jest/examples/react-es6/node_modules/react/lib/ReactCompositeComponent.js:767:34)
        at ReactCompositeComponentMixin._renderValidatedComponent (/.../jest/examples/react-es6/node_modules/react/lib/ReactCompositeComponent.js:793:14)
        at wrapper [as _renderValidatedComponent] (/.../jest/examples/react-es6/node_modules/react/lib/ReactPerf.js:70:21)
        at ReactCompositeComponentMixin.mountComponent (/.../jest/examples/react-es6/node_modules/react/lib/ReactCompositeComponent.js:227:30)
        at wrapper [as mountComponent] (/.../jest/examples/react-es6/node_modules/react/lib/ReactPerf.js:70:21)
        at Object.ReactReconciler.mountComponent (/.../jest/examples/react-es6/node_modules/react/lib/ReactReconciler.js:38:35)
        at mountComponentIntoNode (/.../jest/examples/react-es6/node_modules/react/lib/ReactMount.js:248:32)
        at ReactReconcileTransaction.Mixin.perform (/.../jest/examples/react-es6/node_modules/react/lib/Transaction.js:134:20)
        at batchedMountComponentIntoNode (/.../jest/examples/react-es6/node_modules/react/lib/ReactMount.js:269:15)
        at ReactDefaultBatchingStrategyTransaction.Mixin.perform (/.../jest/examples/react-es6/node_modules/react/lib/Transaction.js:134:20)
        at Object.ReactDefaultBatchingStrategy.batchedUpdates (/.../jest/examples/react-es6/node_modules/react/lib/ReactDefaultBatchingStrategy.js:66:19)
        at Object.batchedUpdates (/.../jest/examples/react-es6/node_modules/react/lib/ReactUpdates.js:110:20)
        at Object.ReactMount._renderNewRootComponent (/.../jest/examples/react-es6/node_modules/react/lib/ReactMount.js:404:18)
        at Object.wrapper [as _renderNewRootComponent] (/.../jest/examples/react-es6/node_modules/react/lib/ReactPerf.js:70:21)
        at Object.ReactMount.render (/.../jest/examples/react-es6/node_modules/react/lib/ReactMount.js:493:32)
        at Object.wrapper [as render] (/.../jest/examples/react-es6/node_modules/react/lib/ReactPerf.js:70:21)
        at Object.ReactTestUtils.renderIntoDocument (/.../jest/examples/react-es6/node_modules/react/lib/ReactTestUtils.js:51:18)
        at Spec.<anonymous> (/.../jest/examples/react-es6/__tests__/CheckboxWithLabel-test.js:22:30)
        at jasmine.Block.execute (/.../jest/vendor/jasmine/jasmine-1.3.0.js:1065:17)
        at jasmine.Queue.next_ (/.../jest/vendor/jasmine/jasmine-1.3.0.js:2098:31)
        at null._onTimeout (/.../jest/vendor/jasmine/jasmine-1.3.0.js:2088:18)
        at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
1 test failed, 0 tests passed (1 total)
Run time: 1.869s
npm ERR! Test failed.  See above for more details.

bench87 added a commit to bench87/jest that referenced this issue Apr 4, 2015
The problem occured because of the following code,

   jest.dontMock('../CheckboxWithLabel');

   was not placed at the top of the result code of babel-jest.
@carlomahfouz
Copy link
Author

Issue related to babel-jest and latest upgrade to 5.0.1
https://github.com/babel/babel-jest/issues/16

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant