Skip to content
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

Strangely in Vitest environment sometimes methods do not return response #4672

Open
BeycanDeveloper opened this issue Mar 30, 2024 · 0 comments
Assignees
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6

Comments

@BeycanDeveloper
Copy link

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

@BeycanDeveloper BeycanDeveloper added investigate Under investigation and may be a bug. v6 Issues regarding v6 labels Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Under investigation and may be a bug. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

2 participants