From 14cd15ef54dc944fcb090eba924e4c92db14a445 Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Tue, 26 Jun 2018 07:38:22 -0700 Subject: [PATCH] Enforce component name Summary: When snapshotting, do not get affected by the building process. Reviewed By: rafeca Differential Revision: D8638527 fbshipit-source-id: 8335fc55c0c85f2ff110db338a5000c7af4b29aa --- jest/mockComponent.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jest/mockComponent.js b/jest/mockComponent.js index e94d467a6..fdd89e82d 100644 --- a/jest/mockComponent.js +++ b/jest/mockComponent.js @@ -17,6 +17,8 @@ module.exports = (moduleName, instanceMethods) => { typeof RealComponent === 'function' ? RealComponent : React.Component; const Component = class extends SuperClass { + static displayName = 'Component'; + render() { const name = RealComponent.displayName ||