Skip to content

Commit

Permalink
improve findByType error message
Browse files Browse the repository at this point in the history
  • Loading branch information
henryqdineen committed Nov 23, 2019
1 parent 54f6673 commit a61158e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-test-renderer/src/ReactTestRenderer.js
Expand Up @@ -40,6 +40,7 @@ import {
ScopeComponent,
} from 'shared/ReactWorkTags';
import invariant from 'shared/invariant';
import getComponentName from 'shared/getComponentName';
import ReactVersion from 'shared/ReactVersion';
import act from './ReactTestRendererAct';

Expand Down Expand Up @@ -334,7 +335,7 @@ class ReactTestInstance {
findByType(type: any): ReactTestInstance {
return expectOne(
this.findAllByType(type, {deep: false}),
`with node type: "${type.displayName || type.name}"`,
`with node type: "${getComponentName(type)}"`,
);
}

Expand Down

0 comments on commit a61158e

Please sign in to comment.