-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(tests): update ANT test to only deploy once, install husky, setup initial unit tests #17
Conversation
These tests take a while to set up, to so avoid deploying multiple ANTs, we deploy one and use it throughout each test.
it.each([ | ||
{ | ||
transactionId: 'NEWnqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs', // too short | ||
ttlSeconds: -MIN_TTL_LENGTH, | ||
}, | ||
{ | ||
transactionId: 'bad record', // too short | ||
ttlSeconds: MIN_TTL_LENGTH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we will move these to unit tests
tests/setRecord.test.ts
Outdated
it.each([ | ||
{ | ||
subDomain: '@', | ||
transactionId: 'CTRLqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs', | ||
expect(state.records[subDomain]).toEqual({ | ||
transactionId: antContractOwnerAddress, | ||
ttlSeconds: MIN_TTL_LENGTH, | ||
}, | ||
{ | ||
subDomain: 'same_as_root', | ||
transactionId: 'CTRLqsybd98-DRk6F6wdbBSkTouUShmnIA-pW4N-Hzs', | ||
ttlSeconds: MIN_TTL_LENGTH, | ||
}, | ||
{ | ||
subDomain: 'remove_this', | ||
ttlSeconds: MIN_TTL_LENGTH * 2, | ||
transactionId: 'CTRLajVdPOhf3fCFDbrRuZXVRhhgNOJjbmgp8kjl2Jc', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with these
global.arlocal = arlocal; | ||
global.arweave = arweave; | ||
global.wallets = wallets; | ||
global.contractIds = contractIds; | ||
global.warp = warp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not work as you think it does @atticusofsparta
const ANT = await ANTDeployer(warp, { | ||
address: defaultOwner[0], | ||
wallet: defaultOwner[1], | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deploying an ANT for every test increases total testing time, so we now only deploy once
beforeEach(async () => { | ||
const { wallet, address } = await getLocalWallet(arweave); | ||
// deploy a separate contract for this test | ||
const { contractTxId } = await deployANTContract({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since we cannot guarantee order of execution - and the result of this test will impact our ability to run other calls on the existing ANT contract - we deploy a separate one. this adds overhead - but prevents inconsistent testing results.
Welcome to Codecov 🎉Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment. Thanks for integrating Codecov - We've got you covered ☂️ |
These tests take a while to set up, to so avoid deploying multiple ANTs, we deploy one and use it throughout each test.