Skip to content

Commit

Permalink
Don't polyfill fetch for Node (#5132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timer committed Sep 27, 2018
1 parent 6510a27 commit 328c312
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-app-polyfill/jsdom.js
Expand Up @@ -6,5 +6,9 @@
*/
'use strict';

// fetch() polyfill for making API calls.
require('whatwg-fetch');
// Make sure we're in a Browser-like environment before importing polyfills
// This prevents `fetch()` from being imported in a Node test environment
if (typeof window !== 'undefined') {
// fetch() polyfill for making API calls.
require('whatwg-fetch');
}

0 comments on commit 328c312

Please sign in to comment.