Skip to content

Commit

Permalink
feat: bump up jest
Browse files Browse the repository at this point in the history
  • Loading branch information
alichherawalla committed Apr 15, 2024
1 parent 830ac07 commit 6492ee3
Show file tree
Hide file tree
Showing 5 changed files with 1,302 additions and 542 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ jobs:
- name: Lint
run: npm run lint

- name: test
run: npm run test

# - name: Test and generate coverage report
# uses: artiomtr/[email protected]
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# threshold: 80
# package-manager: yarn
# skip-step: install
# test-script: yarn test
- name: Test and generate coverage report
uses: artiomtr/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
threshold: 80
package-manager: yarn
skip-step: install
test-script: yarn test

- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
Expand Down
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;
3 changes: 2 additions & 1 deletion 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/**,**/tests/**/*.*
sonar.exclusions=**/android/**,**/ios/**,**/tests/**/*.*,jest.config.js,setupTests.js
sonar.test.inclusions=**/*.test.js
sonar.test.exclusions=**/*.test.js
sonar.javascript.lcov.reportPaths=coverage/lcov.info
sonar.testExecutionReportPaths=reports/test-report.xml
sonar.sourceEncoding=UTF-8
Loading

0 comments on commit 6492ee3

Please sign in to comment.