Skip to content
This repository was archived by the owner on Jun 23, 2022. It is now read-only.

Commit 339f177

Browse files
committed
Fix tests
1 parent cea4244 commit 339f177

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ before_script:
2222
git clone https://github.com/gitcoinco/ethavatar.git /tmp/ethavatar
2323
cd /tmp/ethavatar
2424
printf "module.exports = {\nnetworks: {\ndevelopment: {\nhost: \"127.0.0.1\",\nport: 8545,\nnetwork_id: \"*\"\n}\n}\n}" > truffle.js
25-
rm -rf build && truffle migrate
25+
truffle migrate
2626
)
2727
2828
# Copy smart contract to package

test/client.spec.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ describe('EthAvatar', function () {
9494
})
9595

9696
it('should use provided ENS domain', async function () {
97-
const web3 = new Web3('https://cloudflare-eth.com')
97+
const provider = process.env.INFURA_PROJECT_ID ? 'https://mainnet.infura.io/v3/' + process.env.INFURA_PROJECT_ID : 'https://cloudflare-eth.com'
98+
const web3 = new Web3(provider)
9899
const ethavatar = new EthAvatar(web3)
99100

100101
const domain = 'ethereum.eth'
@@ -121,7 +122,8 @@ describe('EthAvatar', function () {
121122
})
122123

123124
it('should not use ENS on unexisting domain', async function () {
124-
const web3 = new Web3('https://cloudflare-eth.com')
125+
const provider = process.env.INFURA_PROJECT_ID ? 'https://mainnet.infura.io/v3/' + process.env.INFURA_PROJECT_ID : 'https://cloudflare-eth.com'
126+
const web3 = new Web3(provider)
125127
const ethavatar = new EthAvatar(web3)
126128

127129
const domain = 'this-domain-does-not-exist-on-mainnet-because-it-is-only-for-testing-of-unexisting-domains.eth'
@@ -204,8 +206,8 @@ describe('EthAvatar', function () {
204206
describe('#watch()', function () {
205207
it('should watch for avatar changes', async function () {
206208
ethavatar.watch(async (result) => {
207-
const expected = web3.eth.accounts[0]
208-
const actual = result.hashAddres
209+
const expected = (await web3.eth.getAccounts())[0]
210+
const actual = result.hashAddress
209211

210212
assert.strictEqual(actual, expected, 'Watching address is not correct')
211213
})

0 commit comments

Comments
 (0)