You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I seem to be having a bit of a problem with mocked instances that have child objects that use private fields.
A short piece of code replicating the issue:
importtestfrom"ava"import{Mock}from"typemoq"import*ascryptofrom"crypto"classUUID{
#uuid: stringconstructor(uuid: string=crypto.randomUUID()){this.#uuid =uuid}toString(){returnthis.#uuid
}}test("test mock with a private field in a child object",t=>{constuuid=newUUID()t.assert(uuid.toString(),uuid.toString())// this worksconstmock=Mock.ofInstance({ uuid })mock.object.uuid.toString()// this throws an error})
The error I'm getting is the following:
I think it has something to do with how proxies are used in typemoq.
If I'm missing something, I'd appreciate if someone could direct me to a solution. Otherwise, it seems to be a big problem which needs solving. I'm happy to work on it and create a PR but I would need some direction on how to solve it.
Thanks.
The text was updated successfully, but these errors were encountered:
Hi, I seem to be having a bit of a problem with mocked instances that have child objects that use private fields.
A short piece of code replicating the issue:
The error I'm getting is the following:
I think it has something to do with how proxies are used in typemoq.
If I'm missing something, I'd appreciate if someone could direct me to a solution. Otherwise, it seems to be a big problem which needs solving. I'm happy to work on it and create a PR but I would need some direction on how to solve it.
Thanks.
The text was updated successfully, but these errors were encountered: