Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const scenarioRoutes = scenarios.reduce((acc, scenario) => {
acc[scenario.key] = {
screen: scenario.Screen,
navigationOptions: { title: scenario.label },
};
return acc;
}, {});
const MainNavigator = createStackNavigator({
Home: { screen: HomeScreen },
...scenarioRoutes,
});
const AppContainer = createAppContainer(MainNavigator);
const store = new TestHookStore();
const navigateAndRun = (scenario) => {
console.log('in navigateAndRun')
return (spec) => {
// Override `it` so that it presses into the scene for this test first.
const origIt = spec.it;
spec.it = (label, f) => {
origIt.call(spec, label, async () => {
await spec.press(scenario.key);
await f();
});
};
scenario.spec(spec);
}
}
import React, { Component } from 'react'
import { Platform } from 'react-native'
import App from '../components/App'
import { Tester, TestHookStore } from 'cavy'
import Onboarding from './tests/Onboarding.js'
import AppLoading from './tests/AppLoading.js'
import Contact from './tests/Contact.js'
import Chat from './tests/Chat.js'
import DevTools from './tests/DevTools.js'
const testHookStore = new TestHookStore()
const redirectConsoleLogsToTerminal = () => {
if (Platform.OS !== 'web') {
let DEBUG_LEVEL = 0
let INFO_LEVEL = 1
let WARN_LEVEL = 2
let ERROR_LEVEL = 3
console.log = log => global.nativeLoggingHook(log, DEBUG_LEVEL)
console.info = log => global.nativeLoggingHook(log, INFO_LEVEL)
console.warn = log => global.nativeLoggingHook(log, WARN_LEVEL)
console.error = log => global.nativeLoggingHook(log, ERROR_LEVEL)
}
}
const getReportServerInfos = () => {
import React, { Component } from 'react'
import { Platform } from 'react-native'
import { Tester, TestHookStore } from 'cavy'
import Onboarding from './tests/Onboarding.js'
import AppLoading from './tests/AppLoading.js'
import Contact from './tests/Contact.js'
import Chat from './tests/Chat.js'
import DevTools from './tests/DevTools.js'
const testHookStore = new TestHookStore()
const redirectConsoleLogsToTerminal = () => {
if (Platform.OS !== 'web') {
let DEBUG_LEVEL = 0
let INFO_LEVEL = 1
let WARN_LEVEL = 2
let ERROR_LEVEL = 3
console.log = log => global.nativeLoggingHook(log, DEBUG_LEVEL)
console.info = log => global.nativeLoggingHook(log, INFO_LEVEL)
console.warn = log => global.nativeLoggingHook(log, WARN_LEVEL)
console.error = log => global.nativeLoggingHook(log, ERROR_LEVEL)
}
}
const getReportServerInfos = () => {
/**
* @format
*/
import React, { Component } from 'react';
import {AppRegistry} from 'react-native';
import {name as appName} from './app.json';
import { Tester, TestHookStore } from 'cavy';
import EmployeeDirectoryApp from './app/EmployeeDirectoryApp';
import EmployeeListSpec from './specs/EmployeeListSpec';
const testHookStore = new TestHookStore();
class AppWrapper extends Component {
render() {
return (
);
}
}
AppRegistry.registerComponent(appName, () => AppWrapper);
/** @format */
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
import { Tester, TestHookStore } from 'cavy';
import EmployeeDirectoryApp from './app/EmployeeDirectoryApp';
import EmployeeListSpec from './specs/EmployeeListSpec';
const testHookStore = new TestHookStore();
class AppWrapper extends Component {
render() {
return (
);
}
}
AppRegistry.registerComponent(appName, () => AppWrapper);