Skip to content

Commit

Permalink
Actually test for the presence of window.fetch.
Browse files Browse the repository at this point in the history
This makes gaxios compatible with tests running with jsdom which defines
`window`.
  • Loading branch information
wilhuff committed Apr 26, 2019
1 parent 37940dc commit fafb54a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/isbrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
*/

export function isBrowser(): boolean {
return typeof window !== 'undefined';
return typeof window !== 'undefined' &&
typeof window.fetch !== 'undefined';
}

0 comments on commit fafb54a

Please sign in to comment.