Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated test suite and improve project structure
using constants for screen names now for avoiding mistakes.
- Loading branch information
1 parent
8ad67d4
commit d75afbf
Showing
7 changed files
with
42 additions
and
17 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
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,13 +1,16 @@ | ||
import { Navigation } from 'react-native-navigation' | ||
|
||
import { registerScreens } from './screens' | ||
import { LANDING } from './screens/constants' | ||
|
||
// register all the screens | ||
registerScreens() | ||
|
||
// start the app | ||
Navigation.startSingleScreenApp({ | ||
screen: { | ||
screen: 'Landing', | ||
title: 'Landing' | ||
screen: LANDING | ||
} | ||
}); | ||
}) | ||
|
||
export default Navigation |
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,12 +1,11 @@ | ||
// import 'react-native'; | ||
// import * as React from 'react'; | ||
// import * as renderer from 'react-test-renderer'; | ||
// import {} from 'jest' | ||
import {} from 'jest' | ||
import * as _ from 'lodash' | ||
import { Navigation } from 'react-native-navigation' | ||
|
||
// import App from '../App'; | ||
import App from '../App' | ||
|
||
// it('renders correctly', () => { | ||
// const tree = renderer.create( | ||
// <App /> | ||
// ); | ||
// }); | ||
describe('App', () => { | ||
it('got a Navigation object', () => { | ||
expect(_.isEqual(App, Navigation)).toBe(true) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import 'react-native'; | ||
import * as React from 'react'; | ||
import * as renderer from 'react-test-renderer'; | ||
import {} from 'jest' | ||
|
||
import Landing from '../'; | ||
|
||
describe('Landing Screen', () => { | ||
it('renders correctly', () => { | ||
const tree = renderer.create( | ||
<Landing /> | ||
); | ||
}); | ||
}) |
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// using constants for screen names for avoiding mistakes | ||
export const LANDING:string = 'Landing' |
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,7 +1,8 @@ | ||
import { Navigation } from 'react-native-navigation'; | ||
import { Navigation } from 'react-native-navigation' | ||
|
||
import Landing from './Landing'; | ||
import Landing from './Landing' | ||
import { LANDING } from './constants' | ||
|
||
export function registerScreens() { | ||
Navigation.registerComponent('Landing', () => Landing); | ||
} | ||
Navigation.registerComponent(LANDING, () => Landing) | ||
} |
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