Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

Commit

Permalink
improve test for specific issue
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-aurele-besner committed Oct 22, 2022
1 parent d430f2b commit 0d1ae27
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions test/addressBook.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe('Integration tests', function () {
)
})

it('2x saveContract() (same contract twice, replacing 1st entry)', function () {
it('4x saveContract() (2 different contracts twice, replacing 1st entry)', function () {
this.hre.addressBook.saveContract(
'MockERC20',
'0x0000000000000000000000000000000000000000',
Expand All @@ -83,6 +83,15 @@ describe('Integration tests', function () {
'0x0000000000000000000000000000000000000001',
1
)
this.hre.addressBook.saveContract(
'MockERC20-B',
'0x0000000000000000000000000000000000000001',
'hardhat',
'0x0000000000000000000000000000000000000001',
0,
'0x0000000000000000000000000000000000000002',
2
)
this.hre.addressBook.saveContract(
'MockERC20',
'0x0000000000000000000000000000000000000001',
Expand All @@ -92,11 +101,20 @@ describe('Integration tests', function () {
'0x0000000000000000000000000000000000000002',
2
)
this.hre.addressBook.saveContract(
'MockERC20-B',
'0x0000000000000000000000000000000000000001',
'hardhat',
'0x0000000000000000000000000000000000000001',
0,
'0x0000000000000000000000000000000000000002',
2
)
expect(this.hre.addressBook.retrieveContract('MockERC20', 'hardhat')).to.be.equal(
'0x0000000000000000000000000000000000000001'
)
const data = fs.readFileSync('./contractsAddressDeployed.json')
expect(JSON.parse(data.toString()).length).to.be.equal(1)
expect(JSON.parse(data.toString()).length).to.be.equal(2)
})

it('saveContract() wit extra arguments, then clean then from log', function () {
Expand Down

0 comments on commit 0d1ae27

Please sign in to comment.