Skip to content

Commit

Permalink
refactor(blockfrost): remove any typecasts
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyslbw committed Sep 28, 2021
1 parent c25e570 commit f4f35ff
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions packages/blockfrost/test/blockfrostProvider.test.ts
Expand Up @@ -36,9 +36,8 @@ describe('blockfrostProvider', () => {
}
} as Responses['network'];

// eslint-disable-next-line @typescript-eslint/no-explicit-any
BlockFrostAPI.prototype.epochsLatest = jest.fn().mockResolvedValue(mockedEpochsLatestResponse) as any;
BlockFrostAPI.prototype.network = jest.fn().mockResolvedValue(mockedNetworkResponse) as any;
BlockFrostAPI.prototype.epochsLatest = jest.fn().mockResolvedValue(mockedEpochsLatestResponse);
BlockFrostAPI.prototype.network = jest.fn().mockResolvedValue(mockedNetworkResponse);

const client = blockfrostProvider({ projectId: apiKey, isTestnet: true });
const response = await client.networkInfo();
Expand Down Expand Up @@ -87,10 +86,9 @@ describe('blockfrostProvider', () => {
'pool13dgxp4ph2ut5datuh5na4wy7hrnqgkj4fyvac3e8fzfqcc7qh0h'
] as Responses['pool_list'];

// eslint-disable-next-line @typescript-eslint/no-explicit-any
BlockFrostAPI.prototype.pools = jest.fn().mockResolvedValue(mockedActivePoolsResponse) as any;
BlockFrostAPI.prototype.poolsRetired = jest.fn().mockResolvedValue(mockedRetiredPoolsResponse) as any;
BlockFrostAPI.prototype.poolsRetiring = jest.fn().mockResolvedValue(mockedRetiringPoolsResponse) as any;
BlockFrostAPI.prototype.pools = jest.fn().mockResolvedValue(mockedActivePoolsResponse);
BlockFrostAPI.prototype.poolsRetired = jest.fn().mockResolvedValue(mockedRetiredPoolsResponse);
BlockFrostAPI.prototype.poolsRetiring = jest.fn().mockResolvedValue(mockedRetiringPoolsResponse);

const client = blockfrostProvider({ projectId: apiKey, isTestnet: true });
const response = await client.stakePoolStats();
Expand Down Expand Up @@ -434,8 +432,8 @@ describe('blockfrostProvider', () => {
next_block: null,
confirmations: 0
} as Responses['block_content'];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
BlockFrostAPI.prototype.blocksLatest = jest.fn().mockResolvedValue(mockedResponse) as any;

BlockFrostAPI.prototype.blocksLatest = jest.fn().mockResolvedValue(mockedResponse);

const client = blockfrostProvider({ projectId: apiKey, isTestnet: true });
const response = await client.ledgerTip();
Expand Down

0 comments on commit f4f35ff

Please sign in to comment.