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

React suspense Error: Method “props” is meant to be run on 1 node. 0 found instead. #2033

Closed
1 task done
DonikaV opened this issue Mar 5, 2019 · 3 comments
Closed
1 task done
Projects

Comments

@DonikaV
Copy link

DonikaV commented Mar 5, 2019

API

  • shallow

Version

library version
enzyme 3.9
react 16.8.3
react-dom 16.8.3
react-test-renderer
enzyme-adapter-react-16 1.10.0

I updated react and test libraries today . App works fine, lazy loading etc.. but my tests are failing..


 it("Should render", async () => {
        const wrapper = shallow(<MyParentComponent {...props} />);
        expect(wrapper.find("MyChildrenComponent").props()).toEqual({HERE PROPS})

/// MyParent component render

render() {
        return (
            <div>
                <React.Suspense fallback={<Spinner/>}>
                    <MyChildrenComponent/>

But i have error

Error: Method “props” is meant to be run on 1 node. 0 found instead.

@ljharb
Copy link
Member

ljharb commented Mar 5, 2019

enzyme does not currently support Suspense; closing in favor of #1917.

@ljharb ljharb closed this as completed Mar 5, 2019
@ljharb ljharb added this to v16.6+: memo, lazy, suspense in React 16 Mar 5, 2019
@DonikaV
Copy link
Author

DonikaV commented Mar 5, 2019

There are any workaround to fix this? Thanks in advance :)

@ljharb
Copy link
Member

ljharb commented Mar 6, 2019

No, the workaround is to not use Suspense yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
React 16
  
v16.6+: memo, lazy, suspense
Development

No branches or pull requests

2 participants