enzymejs/enzyme

Shallow(<SomeComponent />).is(SomeComponent) returns false

Open

#768 opened on 2017年1月12日

GitHub で見る
 (14 comments) (0 reactions) (0 assignees)JavaScript (19,979 stars) (2,016 forks)batch import
API: mountbughelp wanted

説明

Basically, this fails:

it('should be true', () => {
  const SomeComponent = () => (<div></div>);
  expect(shallow(<SomeComponent />).is(SomeComponent)).to.be.true;
});

while this works:

  // require('jsdom')...
  it('should be true', () => {
    const SomeComponent = () => (<div></div>);
    expect(mount(<SomeComponent />).is(SomeComponent)).to.be.true;
  });

Am I wrong to assume the first one should work too?

コントリビューターガイド

Shallow(<SomeComponent />).is(SomeComponent) returns false · enzymejs/enzyme#768 | Good First Issue