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

how to unfake fake one. #180

Open
novaknole opened this issue Jan 6, 2023 · 0 comments
Open

how to unfake fake one. #180

novaknole opened this issue Jan 6, 2023 · 0 comments

Comments

@novaknole
Copy link

novaknole commented Jan 6, 2023

it("test 1", async () => {
   const fake = await smock.fake("contractExample", {
         address: contractExample.address
   })
   
   expect(fake.execute).has.been.calledWith(1); // Works great
})

it("test 2", async () => {
   await contractExample.getAction(); 
})

Problem is that I deploy contractExample in before hook, only one time. in test1, I replace it with fake, but in test2, I need the original one, because await contractExample.getAction(); returns 0x...0, since it became a fake. How can I reset it in test1, so on contractExample.address, even in test 2, we got fake, and I need original.

How can I achieve it ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant