How to use the inferno-test-utils.renderToSnapshot function in inferno-test-utils

To help you get started, we’ve selected a few inferno-test-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github infernojs / inferno / packages / inferno-test-utils / __tests__ / testUtils.jest.spec.jsx View on Github external
it('should return a snapshot with className prop', () => {
    const TestComponent = () =&gt; <div>Test</div>;

    const snapshot = TestUtils.renderToSnapshot();

    if (usingJest) {
      expect(snapshot).toMatchSnapshot();
    } else {
      expect(snapshot.props.className).toBe('test');
    }
  });
github infernojs / inferno / packages / inferno-test-utils / __tests__ / snapshots.spec.jsx View on Github external
it('Should render fragment from component root', () =&gt; {
        class Comp extends Component {
          render() {
            return &lt;&gt;{this.props.children};
          }
        }

        expect(
          renderToSnapshot(
            
              <div>1</div>
            
          )
        ).toMatchSnapshot();
      });