-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
281 additions
and
4,810 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,35 +1,28 @@ | ||
{ | ||
"extends": ["standard", "standard-react"], | ||
"env": { | ||
"es6": true, | ||
"jest": true | ||
}, | ||
"plugins": ["react", "jest"], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
// Indent with 4 spaces | ||
"indent": [2, "tab"], | ||
"react/jsx-indent": [2, "tab"], | ||
"react/jsx-indent-props": [2, "tab"], | ||
"extends": ["standard", "standard-react"], | ||
"env": { | ||
"es6": true | ||
}, | ||
"plugins": ["react"], | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
// Indent with 4 spaces | ||
"indent": [2, "tab"], | ||
"react/jsx-indent": [2, "tab"], | ||
"react/jsx-indent-props": [2, "tab"], | ||
|
||
//allow tabs | ||
"no-tabs": "off", | ||
//allow tabs | ||
"no-tabs": "off", | ||
|
||
// don't force es6 functions to include space before paren | ||
"space-before-function-paren": 0, | ||
// don't force es6 functions to include space before paren | ||
"space-before-function-paren": 0, | ||
|
||
// allow specifying true explicitly for boolean props | ||
"react/jsx-boolean-value": 0, | ||
// allow specifying true explicitly for boolean props | ||
"react/jsx-boolean-value": 0, | ||
|
||
// disable warnings when using setState in componentDidUpdate | ||
"react/no-did-update-set-state": "off", | ||
|
||
"jest/no-disabled-tests": "warn", | ||
"jest/no-focused-tests": "error", | ||
"jest/no-identical-title": "error", | ||
"jest/prefer-to-have-length": "warn", | ||
"jest/valid-expect": "error" | ||
} | ||
// disable warnings when using setState in componentDidUpdate | ||
"react/no-did-update-set-state": "off" | ||
} | ||
} |
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,4 +1,3 @@ | ||
coverage/**/* | ||
node_modules/**/* | ||
.expo/* | ||
npm-debug.* | ||
|
This file was deleted.
Oops, something went wrong.
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,17 +1,29 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import App from '../App' | ||
import React from 'react'; | ||
import NavigationTestUtils from 'react-navigation/NavigationTestUtils'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import Main from '../src/Main'; | ||
|
||
jest.mock('expo', () => ({ | ||
AppLoading: 'AppLoading' | ||
})) | ||
AppLoading: 'AppLoading', | ||
})); | ||
|
||
jest.mock('../navigation/AppNavigator', () => 'AppNavigator'); | ||
|
||
describe('Main', () => { | ||
it('renders the loading screen', () => { | ||
expect(renderer.create(<App />).toJSON()).toMatchSnapshot() | ||
}) | ||
jest.useFakeTimers(); | ||
|
||
beforeEach(() => { | ||
NavigationTestUtils.resetInternalState(); | ||
}); | ||
|
||
it(`renders the loading screen`, () => { | ||
const tree = renderer.create(<Main />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders the root without loading screen', () => { | ||
expect(renderer.create(<App skipLoadingScreen />).toJSON()).toMatchSnapshot() | ||
}) | ||
}) | ||
it(`renders the root without loading screen`, () => { | ||
const tree = renderer.create(<Main skipLoadingScreen />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.