ethers.js
ethers.js copied to clipboard
Strangely in Vitest environment sometimes methods do not return response
Ethers Version
6.11.1
Search Terms
not return response
Describe the Problem
Strangely the getBlock method does not return response in Vitest environment. It just waits. When I create a normal test.ts file and try it, I get a response without any problem.
Code Snippet
it('Block Timestamp', async () => {
expect(await tx.getBlockTimestamp()).toBe(1710140424)
})
async getBlockTimestamp(): Promise<number> {
const blockNumber = await this.getBlockNumber()
const block = await this.ethers.getBlock(blockNumber)
return block?.timestamp ?? 0
}
Contract ABI
No response
Errors
No response
Environment
No response
Environment (Other)
No response