Hey guys, why every time I'm running hardhat test I need to run hardhat deploy --reset first? otherwise test will run using old previous deployed test contract. honestly it's bit annoying.

I tried using await hre.network.provider.send("hardhat_reset") but it's still error and use previous contract code.

Is this because I'm not running using deployFixture? or is there any other workaround?

I'm using openzeppelin uups proxy anyway.

Nov 2, 2023, 4:10 AM
if you don't specify the network, it goes on hardhat network and it's a clean state each time you run it.
Are you running the node on another window?
Nov 2, 2023, 4:12 AM
I was expecting same behavior. Anyway I'm using plugin hardhat-deploy is this cause of the problem?

I'm not specifying network. I tried to run —network localhost and run npx hardhat node it's still error. Even after I add --deploy-fixture
Nov 2, 2023, 4:15 AM
yep, i've never used hardhat-deploy and never had that issue 😅
Nov 2, 2023, 4:16 AM
Are you using hardhat scripts for deployment?
Nov 2, 2023, 4:17 AM
i did over 100 workspaces in hardhat i think :S
those weeks i'm using foundry for scripts too, it's killing it but hardhat still hardhat
Nov 2, 2023, 4:18 AM
great, ok thanks
Nov 2, 2023, 4:20 AM

© 2024 Draquery.com All rights reserved.