Skip to content

Commit

Permalink
Have Jest correctly transpile ESM imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cag committed Sep 29, 2020
1 parent 1e58f02 commit e8bd3bc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@
"pre-push": "yarn lint:check"
}
},
"jest": {
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\](?!(contract-proxy-kit))[/\\\\].*\\.(js|jsx|mjs|cjs|ts|tsx)$",
"^.+\\.module\\.(css|sass|scss)$"
]
},
"browserslist": {
"production": [
">0.2%",
Expand Down
4 changes: 2 additions & 2 deletions app/src/hooks/useCpk.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CPK from 'contract-proxy-kit'
import EthersAdapter from 'contract-proxy-kit/lib/cjs/ethLibAdapters/EthersAdapter'
import CPK from 'contract-proxy-kit/lib/esm'
import EthersAdapter from 'contract-proxy-kit/lib/esm/ethLibAdapters/EthersAdapter'
import { ethers } from 'ethers'
import { useEffect, useState } from 'react'
import { useWeb3Context } from 'web3-react'
Expand Down
4 changes: 2 additions & 2 deletions app/src/services/cpk.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import CPK from 'contract-proxy-kit'
import EthersAdapter from 'contract-proxy-kit/lib/cjs/ethLibAdapters/EthersAdapter'
import CPK from 'contract-proxy-kit/lib/esm'
import EthersAdapter from 'contract-proxy-kit/lib/esm/ethLibAdapters/EthersAdapter'
import { ethers } from 'ethers'
import { TransactionReceipt, Web3Provider } from 'ethers/providers'
import { BigNumber } from 'ethers/utils'
Expand Down

0 comments on commit e8bd3bc

Please sign in to comment.