Skip to content

Commit

Permalink
[add] Platform.isTesting
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed Oct 4, 2019
1 parent 304e8a8 commit ad674e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react-native-web/src/exports/Platform/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@

const Platform = {
OS: 'web',
select: (obj: Object) => ('web' in obj ? obj.web : obj.default)
select: (obj: Object) => ('web' in obj ? obj.web : obj.default),
get isTesting(): boolean {
if (process.env.NODE_DEV === 'test') {
return true;
}
return false;
}
};

export default Platform;

0 comments on commit ad674e4

Please sign in to comment.