Skip to content

Commit

Permalink
Merge pull request #85 from wednesday-solutions/feat/readme
Browse files Browse the repository at this point in the history
feat: update readme
  • Loading branch information
alichherawalla authored Apr 15, 2024
2 parents 930eb2e + 6492ee3 commit 434bc5e
Show file tree
Hide file tree
Showing 7 changed files with 1,312 additions and 558 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,9 @@ jobs:
skip-step: install
test-script: yarn test

- name: Tests
run: npm run test

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ The React Native Template contains:
- [Redux](https://redux.js.org/) (v4.0.1) to help manage state
- [Redux Persist](https://github.com/rt2zz/redux-persist) (v5.10.0) to persist the Redux state
- [Redux Sagas](https://redux-saga.js.org) (v1.0.2) to separate side-effects and logic from state and UI logic
- [React Navigation](https://reactnavigation.org/) (v3.11.2) with a [`NavigationService`](app/services/NavigationService.js) to handle routing and navigation in the app, with a splash screen setup by default
- [React Navigation](https://reactnavigation.org/) (v3.11.2) with a [`NavigationService`](app/services/navigationService.js) to handle routing and navigation in the app, with a splash screen setup by default
- [reduxsauce](https://github.com/infinitered/reduxsauce) (v1.0.1) to facilitate using Redux
- [apisauce](https://github.com/infinitered/apisauce/) to make API calls (v0.19.0)
- [prettier](https://prettier.io/) and [eslint](https://eslint.org/) preconfigured for React Native
Expand Down
35 changes: 15 additions & 20 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ module.exports = {
'!app/app.js',
'!app/global-styles.js',
'!app/*/*/Loadable.{js,jsx}',
'!**/coverage/**',
'!**/coverage/**'
],
"reporters": [
"default",
reporters: [
'default',
[
"jest-sonar",
'jest-sonar',
{
"outputDirectory": "reports",
"outputName": "test-report.xml",
"relativeRootDir": "./",
"reportedFilePath": "relative"
outputDirectory: 'reports',
outputName: 'test-report.xml',
relativeRootDir: './',
reportedFilePath: 'relative'
}
]
],
Expand All @@ -26,23 +26,18 @@ module.exports = {
statements: 50,
branches: 50,
functions: 50,
lines: 50,
},
lines: 50
}
},
preset: 'react-native',
moduleDirectories: ['node_modules', 'app'],
moduleNameMapper: {
'@app(.*)$': '<rootDir>/app/$1',
'@(atoms|molecules|organisms)(.*)$': '<rootDir>/app/components/$1/$2',
'@(containers|components|services|utils|themes|scenes|navigators)(.*)$': '<rootDir>/app/$1/$2'
'@(containers|components|services|utils|themes|scenes|navigators)(.*)$':
'<rootDir>/app/$1/$2'
},
"setupFiles": [
"./node_modules/react-native-gesture-handler/jestSetup.js"
],
"setupFilesAfterEnv": [
"./setupTests.js"
],
"transformIgnorePatterns": [
"/node_modules/(?!react-native)/.+"
]
setupFiles: ['./node_modules/react-native-gesture-handler/jestSetup.js'],
setupFilesAfterEnv: ['./setupTests.js'],
transformIgnorePatterns: ['/node_modules/(?!react-native)/.+']
};
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"eslint-plugin-redux-saga": "^1.1.1",
"eslint-plugin-standard": "^4.0.0",
"husky": "^3.0.8",
"jest": "^24.5.0",
"jest": "^25.5.4",
"jest-sonar": "^0.2.16",
"pre-commit": "1.2.2",
"prettier": "^1.18.2",
Expand Down
9 changes: 9 additions & 0 deletions setupTests.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';

jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);

jest.mock('redux-persist', () => {
const real = jest.requireActual('redux-persist');
return {
...real,
persistReducer: jest.fn().mockImplementation((config, reducers) => reducers)
};
});

console.disableYellowBox = true;
7 changes: 4 additions & 3 deletions sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ sonar.projectKey=wednesday-solutions_react-native-template_AY7hdnRSB2n8RRmGoU2M
sonar.language=js
sonar.sources=.
sonar.tests=app
sonar.exclusions=**/android/**,**/ios/**,**/node_modules/**
sonar.exclusions=**/android/**,**/ios/**,**/tests/**/*.*,jest.config.js,setupTests.js
sonar.test.inclusions=**/*.test.js
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
sonar.testExecutionReportPaths=./reports/test-report.xml
sonar.test.exclusions=**/*.test.js
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.testExecutionReportPaths=reports/test-report.xml
sonar.sourceEncoding=UTF-8
Loading

1 comment on commit 434bc5e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 93.2% 192/206
🟢 Branches 87.8% 36/41
🟢 Functions 89.74% 70/78
🟢 Lines 93.85% 168/179

Test suite run success

48 tests passing in 20 suites.

Report generated by 🧪jest coverage report action from 434bc5e

Please sign in to comment.