Closed olifur closed 2 years ago
looks to me like mockBlockchain
function return object gets wrapped by a spy
https://github.com/DePayFi/web3-mock/blob/797ebec6eab37a0ee65d2b08cba84135bb93d270/src/mock.js#L106
but mock
function missed the spy wrap
https://github.com/DePayFi/web3-mock/blob/797ebec6eab37a0ee65d2b08cba84135bb93d270/src/mock.js#L131
return mock
is the mock created by mockBlockchain
.
mockBlockchain
is the only occasion for the mock
variable getting set: see https://github.com/DePayFi/web3-mock/blob/797ebec6eab37a0ee65d2b08cba84135bb93d270/src/mock.js#L125
web3-mock currently only implements the jest spy attribute calls (as you can see in your error message it's right there)...
what is Cypress requirement for the to.have.been.called
matcher? can you point to the implementation of this matcher?
Cypress 10.x ships with chai, as the default assertion library:
https://docs.cypress.io/guides/references/assertions
Chai assertions
I've just released 13.7.0 which is fixing cypress matcher/assertions
https://github.com/DePayFi/web3-mock/releases/tag/v13.7.0
Make sure you migrate to the 12+ syntax to mock requests (it's mock({request: ...})
and not mock({call: ...})
anymore).
btw. Cypress assertions/matchers do look like this: https://docs.cypress.io/guides/references/assertions#Sinon-Chai not like pure chai BDD
Hi!
On
@depay/web3-mock@11.11.0 and also on 12.x
I have the following problem:When I run the following code using cypress (taken and slightly modified from the Advanced demo)
I get the following problem when I am running it in cypress
a
console.log(balanceOfMock)
suggests that it is a normal{}
object and not a function.