Skip to content

Commit

Permalink
Merge pull request #392 from ar-io/develop
Browse files Browse the repository at this point in the history
Release arweave.app integration to prod
  • Loading branch information
atticusofsparta authored Dec 18, 2023
2 parents 216161e + b1ae578 commit 4f50fe1
Show file tree
Hide file tree
Showing 50 changed files with 4,549 additions and 2,262 deletions.
18 changes: 18 additions & 0 deletions __mocks__/react-router-dom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const mock = {
__esModule: true,

...jest.requireActual('react-router-dom'),
useLocation: jest.fn(() => ({
pathname: '/',
search: '',
hash: '',
state: null,
key: '5nvxpbdafa',
})),
useNavigate: jest.fn(() => jest.fn()),
useSearchParams: () => [new URLSearchParams(), jest.fn()],
};

// NOTE: `export default mock` does not work, use module.exports instead
// see https://stackoverflow.com/questions/64037162/how-do-i-mock-react-router-dom-using-jest-from-a-mocks-directory
module.exports = mock;
9 changes: 7 additions & 2 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
"collectCoverageFrom": ["src/**/*.{ts,tsx,js,jsx}", "!src/**/*.d.ts"],
"moduleNameMapper": {
"\\.(css|gif|png)$": "jest-transform-stub",
"\\.svg": "<rootDir>/src/__tests__/__mocks__/svg.js"
"\\.svg": "<rootDir>/tests/common/mocks/svg.js",
"^@tests/(.*)$": "<rootDir>/tests/$1",
"^@src/(.*)$": "<rootDir>/src/$1"
},
"transformIgnorePatterns": [
"/node_modules/(?!arbundles|arweave-wallet-connector).+\\.js$"
],
"moduleDirectories": ["node_modules", "assets"],
"testPathIgnorePatterns": ["src/__tests__/__mocks__"],
"testPathIgnorePatterns": ["tests/common/"],
"coverageThreshold": {
"global": {
"branches": 80,
Expand Down
Loading

0 comments on commit 4f50fe1

Please sign in to comment.