enzymejs / chai-enzyme

Chai.js assertions and convenience functions for testing React Components with enzyme
MIT License
787 stars 72 forks source link

to.have.text(undefined) does not break the tests #216

Open vanpacheco opened 6 years ago

vanpacheco commented 6 years ago

I am not sure whether this is an issue, but I do think this behavior is inconvenient. For instance, the following test passes:

it('has text', () => {
  const test = shallow(<span>Test</span>);
  expect(test).to.have.text(undefined);
});

I'd appreciate any light you shed on why this is happening or on whether this is an issue at all.