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 Feb 28, 2020
1 parent 4ee592e commit 47c1509
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 @@ -42,6 +42,7 @@ import {
ScopeComponent,
} from 'shared/ReactWorkTags';
import invariant from 'shared/invariant';
import getComponentName from 'shared/getComponentName';
import ReactVersion from 'shared/ReactVersion';

import {getPublicInstance} from './ReactTestHostConfig';
Expand Down Expand Up @@ -346,7 +347,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 47c1509

Please sign in to comment.