From 6f84ccf51acd443a7d50526c99ad9866e68c5796 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Fri, 2 Oct 2015 12:27:10 -0700 Subject: [PATCH] Fix tests related to event-target-shim MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: @​public Jest has an issue where if you export `Symbol` it crashes badly. Since event-target-shim does that, it breaks everything. Mocking that module fixes the issue until @cpojer comes back from vacation and fixes the bug in Jest itself. Reviewed By: @jingc Differential Revision: D2503562 --- Libraries/WebSocket/__mocks__/event-target-shim.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Libraries/WebSocket/__mocks__/event-target-shim.js diff --git a/Libraries/WebSocket/__mocks__/event-target-shim.js b/Libraries/WebSocket/__mocks__/event-target-shim.js new file mode 100644 index 00000000000000..3b566fcc94a292 --- /dev/null +++ b/Libraries/WebSocket/__mocks__/event-target-shim.js @@ -0,0 +1,9 @@ +// Jest fatals for the following statement (minimal repro case) +// +// exports.something = Symbol; +// +// Until it is fixed, mocking the entire node module makes the +// problem go away. + +'use strict'; +module.exports = function() {};