-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1099 from bugsnag/rn-test-fixture-linting
Resolve ESLint violations in React Native test fixtures
- Loading branch information
Showing
63 changed files
with
267 additions
and
248 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
dist | ||
examples | ||
features | ||
**/node_modules/** | ||
fixtures | ||
scratch | ||
coverage | ||
packages/core/types/test/*.js | ||
packages/react-native/android/build/reports | ||
packages/**/features | ||
packages/**/fixtures | ||
test/browser | ||
test/expo | ||
test/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...es/app/react_native_navigation_js/scenarios/ReactNavigationBreadcrumbsDisabledScenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import Scenario from './Scenario' | ||
|
||
export class ReactNavigationBreadcrumbsDisabledScenario extends Scenario { | ||
constructor(configuration, extraData, jsConfig) { | ||
constructor (configuration, extraData, jsConfig) { | ||
super() | ||
configuration.enabledBreadcrumbTypes = [] | ||
} | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...res/app/react_native_navigation_js/scenarios/ReactNavigationBreadcrumbsEnabledScenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import Scenario from './Scenario' | ||
|
||
export class ReactNavigationBreadcrumbsEnabledScenario extends Scenario {} | ||
export class ReactNavigationBreadcrumbsEnabledScenario extends Scenario { | ||
} |
8 changes: 4 additions & 4 deletions
8
test/react-native/features/fixtures/app/react_native_navigation_js/scenarios/Scenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
export default class Scenario { | ||
constructor(configuration, extraData, jsConfig) {} | ||
run() {} | ||
run () { | ||
} | ||
|
||
timeout(ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)); | ||
timeout (ms) { | ||
return new Promise(resolve => setTimeout(resolve, ms)) | ||
} | ||
} |
24 changes: 13 additions & 11 deletions
24
test/react-native/features/fixtures/app/react_native_navigation_js/screens/Details.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,30 @@ | ||
import * as React from 'react'; | ||
import {View, Text, Button} from 'react-native'; | ||
import {Navigation} from 'react-native-navigation'; | ||
import * as React from 'react' | ||
import { View, Text, Button } from 'react-native' | ||
import { Navigation } from 'react-native-navigation' | ||
import Bugsnag from '@bugsnag/react-native' | ||
|
||
const DetailsScreen = (props) => { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}> | ||
<Text>Details Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => | ||
Navigation.pop(props.componentId) | ||
} /> | ||
}/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('DetailsNavigationError'))} /> | ||
onPress={() => Bugsnag.notify(new Error('DetailsNavigationError'))}/> | ||
<Button title='Notify unhandled error' | ||
accessibilityLabel='sendUnhandled' | ||
onPress={() => { throw new Error('DetailsNavigationUnhandledError') }} /> | ||
onPress={() => { | ||
throw new Error('DetailsNavigationUnhandledError') | ||
}}/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('detailsSetContext')} /> | ||
onPress={() => Bugsnag.setContext('detailsSetContext')}/> | ||
</View> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default DetailsScreen; | ||
export default DetailsScreen |
26 changes: 13 additions & 13 deletions
26
test/react-native/features/fixtures/app/react_native_navigation_js/screens/Home.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import * as React from 'react'; | ||
import {View, Button, Text} from 'react-native'; | ||
import {Navigation} from 'react-native-navigation'; | ||
import Bugsnag from '@bugsnag/react-native'; | ||
import * as React from 'react' | ||
import { View, Button, Text } from 'react-native' | ||
import { Navigation } from 'react-native-navigation' | ||
import Bugsnag from '@bugsnag/react-native' | ||
|
||
const HomeScreen = (props) => { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={ { flex: 1, alignItems: 'center', justifyContent: 'center' } }> | ||
<Text>Home Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => | ||
onPress={ () => | ||
Navigation.push(props.componentId, { | ||
component: { | ||
name: 'Details' | ||
}, | ||
} | ||
}) | ||
} /> | ||
}/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('HomeNavigationError'))} /> | ||
onPress={ () => Bugsnag.notify(new Error('HomeNavigationError')) }/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('homeSetContext')} /> | ||
onPress={ () => Bugsnag.setContext('homeSetContext') }/> | ||
</View> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default HomeScreen; | ||
export default HomeScreen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 23 additions & 21 deletions
44
...tures/app/react_navigation_js/app/scenarios/ReactNavigationBreadcrumbsDisabledScenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,70 @@ | ||
import Scenario from './Scenario' | ||
import Bugsnag from '@bugsnag/react-native' | ||
import * as React from 'react' | ||
import {View, Text, Button} from 'react-native' | ||
import {createStackNavigator} from '@react-navigation/stack'; | ||
import { View, Text, Button } from 'react-native' | ||
import { createStackNavigator } from '@react-navigation/stack' | ||
|
||
export class ReactNavigationBreadcrumbsDisabledScenario extends Scenario { | ||
constructor(configuration, extraData, jsConfig) { | ||
constructor (configuration, _extraData, _jsConfig) { | ||
super() | ||
configuration.enabledBreadcrumbTypes = [] | ||
} | ||
|
||
view () { | ||
const Stack = createStackNavigator(); | ||
const Stack = createStackNavigator() | ||
return ( | ||
<Stack.Navigator> | ||
<Stack.Screen | ||
name="Home" | ||
component={HomeScreen} | ||
component={ HomeScreen } | ||
/> | ||
<Stack.Screen | ||
name="Details" | ||
component={DetailsScreen} | ||
component={ DetailsScreen } | ||
/> | ||
</Stack.Navigator> | ||
) | ||
} | ||
|
||
run() { | ||
run () { | ||
} | ||
} | ||
|
||
function HomeScreen({navigation}) { | ||
function HomeScreen ({ navigation }) { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={ { flex: 1, alignItems: 'center', justifyContent: 'center' } }> | ||
<Text>Home Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => navigation.navigate('Details')} /> | ||
onPress={ () => navigation.navigate('Details') }/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('HomeNavigationError'))} /> | ||
onPress={ () => Bugsnag.notify(new Error('HomeNavigationError')) }/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('homeSetContext')} /> | ||
onPress={ () => Bugsnag.setContext('homeSetContext') }/> | ||
</View> | ||
); | ||
) | ||
} | ||
|
||
function DetailsScreen({navigation}) { | ||
function DetailsScreen ({ navigation }) { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={ { flex: 1, alignItems: 'center', justifyContent: 'center' } }> | ||
<Text>Details Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => navigation.navigate('Home')} /> | ||
onPress={ () => navigation.navigate('Home') }/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('DetailsNavigationError'))} /> | ||
onPress={ () => Bugsnag.notify(new Error('DetailsNavigationError')) }/> | ||
<Button title='Notify unhandled error' | ||
accessibilityLabel='sendUnhandled' | ||
onPress={() => { throw new Error('DetailsNavigationUnhandledError') }} /> | ||
onPress={ () => { | ||
throw new Error('DetailsNavigationUnhandledError') | ||
} }/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('detailsSetContext')} /> | ||
onPress={ () => Bugsnag.setContext('detailsSetContext') }/> | ||
</View> | ||
); | ||
} | ||
) | ||
} |
45 changes: 23 additions & 22 deletions
45
...xtures/app/react_navigation_js/app/scenarios/ReactNavigationBreadcrumbsEnabledScenario.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,69 @@ | ||
import Scenario from './Scenario' | ||
import Bugsnag from '@bugsnag/react-native' | ||
import * as React from 'react' | ||
import {View, Text, Button} from 'react-native' | ||
import {createStackNavigator} from '@react-navigation/stack' | ||
import { View, Text, Button } from 'react-native' | ||
import { createStackNavigator } from '@react-navigation/stack' | ||
|
||
export class ReactNavigationBreadcrumbsEnabledScenario extends Scenario { | ||
constructor(configuration, extraData, jsConfig) { | ||
constructor (_configuration, _extraData, _jsConfig) { | ||
super() | ||
} | ||
|
||
view () { | ||
const Stack = createStackNavigator(); | ||
const Stack = createStackNavigator() | ||
return ( | ||
<Stack.Navigator> | ||
<Stack.Screen | ||
name="Home" | ||
component={HomeScreen} | ||
component={ HomeScreen } | ||
/> | ||
<Stack.Screen | ||
name="Details" | ||
component={DetailsScreen} | ||
component={ DetailsScreen } | ||
/> | ||
</Stack.Navigator> | ||
) | ||
} | ||
|
||
run() { | ||
// Bugsnag.notify(new Error('ReactNavigationBreadcrumbsEnabledScenario')) | ||
run () { | ||
} | ||
} | ||
|
||
function HomeScreen({navigation}) { | ||
function HomeScreen ({ navigation }) { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={ { flex: 1, alignItems: 'center', justifyContent: 'center' } }> | ||
<Text>Home Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => navigation.navigate('Details')} /> | ||
onPress={ () => navigation.navigate('Details') }/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('HomeNavigationError'))} /> | ||
onPress={ () => Bugsnag.notify(new Error('HomeNavigationError')) }/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('homeSetContext')} /> | ||
onPress={ () => Bugsnag.setContext('homeSetContext') }/> | ||
</View> | ||
); | ||
) | ||
} | ||
|
||
function DetailsScreen({navigation}) { | ||
function DetailsScreen ({ navigation }) { | ||
return ( | ||
<View style={{flex: 1, alignItems: 'center', justifyContent: 'center'}}> | ||
<View style={ { flex: 1, alignItems: 'center', justifyContent: 'center' } }> | ||
<Text>Details Screen</Text> | ||
<Button title='Navigate' | ||
accessibilityLabel='navigate' | ||
onPress={() => navigation.navigate('Home')} /> | ||
onPress={ () => navigation.navigate('Home') }/> | ||
<Button title='Notify handled error' | ||
accessibilityLabel='sendHandled' | ||
onPress={() => Bugsnag.notify(new Error('DetailsNavigationError'))} /> | ||
onPress={ () => Bugsnag.notify(new Error('DetailsNavigationError')) }/> | ||
<Button title='Notify unhandled error' | ||
accessibilityLabel='sendUnhandled' | ||
onPress={() => { throw new Error('DetailsNavigationUnhandledError') }} /> | ||
onPress={ () => { | ||
throw new Error('DetailsNavigationUnhandledError') | ||
} }/> | ||
<Button title='Set context' | ||
accessibilityLabel='setContext' | ||
onPress={() => Bugsnag.setContext('detailsSetContext')} /> | ||
onPress={ () => Bugsnag.setContext('detailsSetContext') }/> | ||
</View> | ||
); | ||
} | ||
) | ||
} |
Oops, something went wrong.