{"size": 702, "ext": "js", "max_stars_repo_path": "src/__tests__/test-isValidComponent.js", "max_stars_repo_name": "uniphil/react-combo-test", "max_stars_repo_stars_event_min_datetime": "2017-07-05T17:53:57.000Z", "max_stars_repo_stars_event_max_datetime": "2018-01-13T19:47:32.000Z", "max_issues_repo_path": "src/__tests__/test-isValidComponent.js", "max_issues_repo_name": "uniphil/react-combo-test", "max_issues_repo_issues_event_min_datetime": "2017-09-05T17:02:49.000Z", "max_issues_repo_issues_event_max_datetime": "2017-09-05T17:02:49.000Z", "max_forks_repo_path": "src/__tests__/test-isValidComponent.js", "max_forks_repo_name": "uniphil/react-combo-test", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 36.9473684211, "max_line_length": 76, "alphanum_fraction": 0.7321937322}
const test = require('tape');
const { Component, createElement } = require('react');
const isValidComponent = require('../isValidComponent');

const SFC = () => null;

class ClassComponent extends Component {
}

test('isValidComponent', assert => {
  assert.plan(6);
  assert.ok(isValidComponent(SFC), 'Stateless components are valid');
  assert.ok(isValidComponent(ClassComponent), 'Class components are valid');
  assert.notOk(isValidComponent(), 'undefined is not a valid component');
  assert.notOk(isValidComponent({}), 'objects are not valid');
  assert.notOk(isValidComponent(null), 'null is not a valid component');
  assert.notOk(isValidComponent(createElement(SFC)), 'JSX is not valid');
});
