diff --git a/jest.config.js b/jest.config.js index 9a8653c4..9efce19e 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,7 +1,7 @@ module.exports = { testEnvironment: 'node', preset: 'ts-jest', - collectCoverage: true, coverageReporters: ['text', 'cobertura'], roots: ['/src'], + testTimeout: 10000, }; diff --git a/src/client/lcd/api/AuthAPI.spec.ts b/src/client/lcd/api/AuthAPI.spec.ts index 092b640f..e95f2073 100644 --- a/src/client/lcd/api/AuthAPI.spec.ts +++ b/src/client/lcd/api/AuthAPI.spec.ts @@ -51,7 +51,7 @@ describe('AuthAPI', () => { describe('module accounts', () => { it('account exists', async () => { - const accts = await auth.moduleAccountInfo('pisco-1'); + const accts = await auth.moduleAccountsInfo('pisco-1'); expect(accts.length).toBeGreaterThan(0); diff --git a/src/client/lcd/api/IbcAPI.spec.ts b/src/client/lcd/api/IbcAPI.spec.ts index 03140f0e..f8c435f8 100644 --- a/src/client/lcd/api/IbcAPI.spec.ts +++ b/src/client/lcd/api/IbcAPI.spec.ts @@ -51,10 +51,10 @@ describe('IbcClientAPI', () => { */ it('channels', async () => { - const [res] = await ibc.channels('pisco-1'); + const res = await ibc.channels('pisco-1'); expect(res).not.toBeNull(); expect(res).not.toBeUndefined(); - expect(res.length).toBeGreaterThan(0); + expect(res.channels.length).toBeGreaterThan(0); }); it('channels for a connection', async () => { diff --git a/src/client/lcd/api/LegacyGovAPI.spec.ts b/src/client/lcd/api/LegacyGovAPI.spec.ts deleted file mode 100644 index 18a50605..00000000 --- a/src/client/lcd/api/LegacyGovAPI.spec.ts +++ /dev/null @@ -1,70 +0,0 @@ -import { LegacyGovAPI } from './LegacyGovAPI'; -import { Coins, Dec, Int, Proposal } from '../../../core'; -import { Deposit } from '@terra-money/terra.proto/cosmos/gov/v1beta1/gov'; -import { LCDClient } from '../LCDClient'; - -const lcd = LCDClient.fromDefaultConfig('testnet'); -const gov = new LegacyGovAPI(lcd); - -describe('GovAPI', () => { - it('parameters', async () => { - await expect(gov.parameters('pisco-1')).resolves.toMatchObject({ - deposit_params: { - min_deposit: expect.any(Coins), - max_deposit_period: expect.any(Number), - }, - voting_params: { - voting_period: expect.any(Number), - }, - tally_params: { - quorum: expect.any(Dec), - threshold: expect.any(Dec), - veto_threshold: expect.any(Dec), - }, - }); - }); - - it('tally', async () => { - const proposalId = await gov.proposals('pisco-1').then(v => v[0][0].id); - await expect(gov.tally(proposalId, 'pisco-1')).resolves.toMatchObject({ - yes: expect.any(Int), - abstain: expect.any(Int), - no: expect.any(Int), - no_with_veto: expect.any(Int), - }); - }); - - it('proposals', async () => { - const proposals = await gov.proposals('pisco-1').then(v => v[0]); - expect(proposals).toContainEqual(expect.any(Proposal)); - }); - - it('proposal', async () => { - const proposalId = await gov.proposals('pisco-1').then(v => v[0][0].id); - const proposal = await gov.proposal(proposalId, 'pisco-1'); - expect(proposal).toEqual(expect.any(Proposal)); - }); - - it('proposer', async () => { - const proposalId = await gov.proposals('pisco-1').then(v => v[0][0].id); - const proposer = await gov.proposer(proposalId, 'pisco-1'); - expect(proposer).toEqual(expect.any(String)); - }); - - it('initialDeposit', async () => { - const proposalId = await gov.proposals('pisco-1').then(v => v[0][0].id); - const initialDeposit = await gov.initialDeposit(proposalId, 'pisco-1'); - expect(initialDeposit).toEqual(expect.any(Coins)); - }); - - it('deposits', async () => { - const proposals = await gov.proposals('pisco-1').then(v => v[0]); - const proposalId = proposals[0].id; - const deposits = await gov - .deposits(proposalId, 'pisco-1') - .then(v => v[0][0]); - if (deposits !== undefined) { - expect(deposits).toEqual(expect.any(Deposit)); - } - }); -}); diff --git a/src/client/lcd/api/UpgradeAPI.spec.ts b/src/client/lcd/api/UpgradeAPI.spec.ts index 2e8feeb1..13a1870d 100644 --- a/src/client/lcd/api/UpgradeAPI.spec.ts +++ b/src/client/lcd/api/UpgradeAPI.spec.ts @@ -25,7 +25,7 @@ describe('UpgradeAPI', () => { describe('node_versions', () => { it('module count', async () => { - expect(await upgrade.moduleVersions('pisco-1')).toHaveLength(28); + expect(await upgrade.moduleVersions('pisco-1')).toHaveLength(30); }); }); });