Disable logbox when RUNNING_E2E=true (#5831)

This commit is contained in:
Joseph Baylon 2021-11-15 13:58:23 -08:00 committed by GitHub
parent 805b90205a
commit 19094f27eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

1
.env
View file

@ -1,2 +1,3 @@
STORYBOOK_PORT=
STORYBOOK_HOST=
RUNNING_E2E=

View file

@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Linking} from 'react-native';
import {Linking, LogBox} from 'react-native';
import {Navigation} from 'react-native-navigation';
import {Provider} from 'react-redux';
@ -10,6 +10,7 @@ import {setDeepLinkURL} from '@actions/views/root';
import {loadMe, logout} from '@actions/views/user';
import {NavigationTypes} from '@constants';
import {CHANNEL, THREAD} from '@constants/screen';
import {RUNNING_E2E} from '@env';
import {getAppCredentials} from '@init/credentials';
import {setupPermanentSidebar} from '@init/device';
import emmProvider from '@init/emm_provider';
@ -154,3 +155,7 @@ export function componentDidDisappearListener({componentId}) {
}
}
}
// Ignore all notifications if running e2e
const isRunningE2e = RUNNING_E2E === 'true';
LogBox.ignoreAllLogs(isRunningE2e);

1
env.d.ts vendored
View file

@ -5,4 +5,5 @@
declare module '@env' {
export const STORYBOOK_HOST: string;
export const STORYBOOK_PORT: number;
export const RUNNING_E2E: string;
}