import _ from 'lodash';

export default function canBeAsserted(vdom) {
    return _.all([].concat(vdom), node =>
        node
        && typeof node === 'object'
        && typeof node.type === 'string'
        && (!node.props || typeof node.props === 'object')
    );
}
import _ from 'lodash';
import React from 'react';

export default function canBeAsserted(vdom) {
    return _.all([].concat(vdom), node =>
        React.isValidElement(node) ||
        (node
        && typeof node === 'object'
        && typeof node.type === 'string'
        && (!node.props || typeof node.props === 'object'))
    );
}
Add validation for local component classes as well First try the official method, then fall-back to duck typing.
Add validation for local component classes as well
First try the official method, then fall-back to duck typing.
