Skip to content

Commit

Permalink
test: configuring setup to test react navigation routes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel-logan committed Sep 4, 2024
1 parent 3641ba3 commit 7abffa0
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions __mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = "test-file-stub";
1 change: 1 addition & 0 deletions __mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ module.exports = {
setupFiles: ["./jest/setupFiles.js"],
moduleNameMapper: {
"\\.svg": "<rootDir>/__mocks__/svgMock.js",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$":
"<rootDir>/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/__mocks__/styleMock.js",
},
};
5 changes: 5 additions & 0 deletions src/Routes/__tests__/DataConverterNavigator.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("DataConverterNavigator", () => {
it("should render correctly", async () => {
expect(true).toBe(true);
});
});
5 changes: 5 additions & 0 deletions src/Routes/__tests__/DrawerNavigator.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
describe("DrawerNavigator", () => {
it("should render correctly", async () => {
expect(true).toBe(true);
});
});
10 changes: 10 additions & 0 deletions src/Routes/__tests__/Routes.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NavigationContainer } from "@react-navigation/native";

Check warning on line 1 in src/Routes/__tests__/Routes.test.tsx

View workflow job for this annotation

GitHub Actions / checking-pr

'NavigationContainer' is defined but never used
import { render } from "@testing-library/react-native";

Check warning on line 2 in src/Routes/__tests__/Routes.test.tsx

View workflow job for this annotation

GitHub Actions / checking-pr

'render' is defined but never used

import Routes from "..";

Check warning on line 4 in src/Routes/__tests__/Routes.test.tsx

View workflow job for this annotation

GitHub Actions / checking-pr

'Routes' is defined but never used

describe("Routes", () => {
it("should render correctly", async () => {
expect(true).toBe(true);
});
});

0 comments on commit 7abffa0

Please sign in to comment.