Skip to content

Commit 050211d

Browse files
committed
attempt to provide a working CustomEvent jest mock so that tests can run
1 parent d1c0843 commit 050211d

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

packages/react-native-renderer/src/ReactNativeBridgeEventPlugin.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ const ReactNativeBridgeEventPlugin = {
199199
const bubbleDispatchConfig = customBubblingEventTypes[topLevelType];
200200
const directDispatchConfig = customDirectEventTypes[topLevelType];
201201
let customEventConfig = null;
202+
console.log('what is CustomEvent?', CustomEvent);
202203
if (nativeEvent instanceof CustomEvent) {
203204
// $FlowFixMe
204205
if (topLevelType.indexOf('on') !== 0) {
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/**
2+
* Copyright (c) Facebook, Inc. and its affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use strict';
9+
10+
// See the react-native repository for a full implementation.
11+
// This is just a stub, currently to pass `instanceof` checks.
12+
const CustomEvent = jest.fn();
13+
14+
module.exports = {default: CustomEvent};

0 commit comments

Comments
 (0)