Skip to content

Commit

Permalink
fix jest tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fionnachan committed Jan 23, 2025
1 parent 3202320 commit e5dd680
Show file tree
Hide file tree
Showing 4 changed files with 708 additions and 375 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const nextJest = require('next/jest')
import nextJest from 'next/jest.js'

const createJestConfig = nextJest({
dir: './'
})

const customJestConfig = {
preset: 'ts-jest',
transform: {
'^.+\\.(ts|tsx)?$': 'ts-jest'
},
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/setupTests.ts'],

Expand All @@ -22,7 +26,8 @@ const transformNodeModules = [
'filter-obj',
// wagmi
'@wagmi',
'wagmi'
'wagmi',
'@rainbow-me/rainbowkit'
]

module.exports = async function () {
Expand Down
5 changes: 3 additions & 2 deletions packages/arb-token-bridge-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.31.10",
"eslint-plugin-react-hooks": "^4.6.0",
"jest": "^29.4.0",
"jest-environment-jsdom": "^29.4.0",
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"patch-package": "^8.0.0",
"postcss": "^8.4.49",
"postinstall-postinstall": "^2.1.0",
Expand All @@ -118,6 +118,7 @@
"satori": "^0.12.0",
"start-server-and-test": "^2.0.9",
"tailwindcss": "^3.4.16",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.2",
"typescript": "^5.2.2"
}
Expand Down
4 changes: 4 additions & 0 deletions packages/arb-token-bridge-ui/setupTests.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import 'cross-fetch/polyfill'
import { TextDecoder, TextEncoder } from 'util'

global.TextEncoder = TextEncoder
global.TextDecoder = TextDecoder

jest.setTimeout(25000)
Loading

0 comments on commit e5dd680

Please sign in to comment.