Skip to content

Commit

Permalink
test: fix uuid import in test with jest, created jestSetup file
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoMolinari95 committed Jan 3, 2025
1 parent cea9ee3 commit 0bf56e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions jestSetup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Set up of the testing environment
*/

jest.mock("uuid", () => {
return {
v4: jest.fn(() => "mocked-uuid"),
};
});
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@
"modulePathIgnorePatterns": [
"<rootDir>/example/node_modules",
"<rootDir>/lib/"
],
"transformIgnorePatterns": [
"node_modules/(?!(jest-)?@react-native|react-native|uuid)"
],
"setupFiles": [
"<rootDir>/jestSetup.js"
]
},
"react-native-builder-bob": {
Expand All @@ -114,4 +120,4 @@
"uuid": "^11.0.3",
"zod": "^3.21.4"
}
}
}

0 comments on commit 0bf56e3

Please sign in to comment.