Skip to content

Commit

Permalink
Merge pull request #154 from ZeroGachis/dependabot/npm_and_yarn/testi…
Browse files Browse the repository at this point in the history
…ng-library/react-native-12.4.2

⬆️ Bump @testing-library/react-native from 12.3.0 to 12.4.2
  • Loading branch information
AdrienCasta authored Dec 27, 2023
2 parents 3b7fbe5 + 6dbf113 commit c686545
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 172 deletions.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const jestConfig: JestConfigWithTsJest = {
'node_modules/(?!(@react-native|react-native|react-native-drop-shadow|@gorhom/bottom-sheet|react-native-reanimated)/)',
],
moduleDirectories: ['node_modules', 'src'],
setupFilesAfterEnv: ['./jest.setup.ts'],
setupFiles: [
'./jest.setup.js',
'./node_modules/react-native-gesture-handler/jestSetup.js',
'./node_modules/react-native/jest/setup.js',
],
Expand Down
3 changes: 2 additions & 1 deletion jest.setup.js → jest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// This 2 following lines are mandatory since we add and use react-native-device-info
import '@testing-library/react-native/extend-expect';
//This 2 following lines are mandatory since we add and use react-native-device-info
import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';
// eslint-disable-next-line no-undef
jest.mock('react-native-device-info', () => mockRNDeviceInfo);
1 change: 1 addition & 0 deletions modules.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare module 'react-native-device-info/jest/react-native-device-info-mock';
175 changes: 11 additions & 164 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"@ZeroGachis:registry": "https://npm.pkg.github.com"
},
"devDependencies": {
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "^12.3.0",
"@testing-library/react-native": "^12.4.2",
"@types/jest": "^29.5.5",
"@types/react": "^18.2.43",
"@types/react-native": "^0.70.0",
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/components/Badge.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('MODULE | Badge', () => {
</ThemeProvider>,
);

expect(screen.getByText('100')).toBeDefined();
expect(screen.getByText('100')).toBeOnTheScreen();
});
});
describe("Given a `number` and a `maxDigits` greater than number's total digit", () => {
Expand All @@ -24,7 +24,7 @@ describe('MODULE | Badge', () => {
</ThemeProvider>,
);

expect(screen.getByText('99+')).toBeDefined();
expect(screen.getByText('99+')).toBeOnTheScreen();
});
});
describe("Given a `number` and a `maxDigits` smaller or equal than number's total digit'", () => {
Expand All @@ -35,7 +35,7 @@ describe('MODULE | Badge', () => {
</ThemeProvider>,
);

expect(screen.getByText('88')).toBeDefined();
expect(screen.getByText('88')).toBeOnTheScreen();
});
});
});
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"strict": true,
"target": "esnext"
},
"include": ["src", "./.eslintrc.json"],
"include": ["src", "./.eslintrc.json", "./modules.d.ts", "./jest.setup.ts"],
"exclude": ["src/components/charts/*"]
}

0 comments on commit c686545

Please sign in to comment.