Skip to content

Commit

Permalink
[enzyme-adapter-utils] [new] add compareNodeTypeOf
Browse files Browse the repository at this point in the history
  • Loading branch information
lh0x00 authored and ljharb committed Nov 30, 2019
1 parent 4fe833c commit f327891
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/enzyme-adapter-utils/src/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,10 @@ export function getWrappingComponentMountRenderer({ toTree, getMountWrapperInsta
export function fakeDynamicImport(moduleToImport) {
return Promise.resolve({ default: moduleToImport });
}

export function compareNodeTypeOf(node, matchingTypeOf) {
if (!node) {
return false;
}
return node.$$typeof === matchingTypeOf;
}

0 comments on commit f327891

Please sign in to comment.