typemoq icon indicating copy to clipboard operation
typemoq copied to clipboard

cause error when argument don't have a default constructor

Open ianhe8x opened this issue 6 years ago • 0 comments

I mocked a method which is called with a argument don't have a default constructor. in MethodInvocation's constructor

if (args) {
      this._args = <any>_.cloneDeep(args);
      this._args.length = args.length;
      this._args.callee = args.callee;
}

and then cause my application throw error.

So why cloneDeep the arguments? Is there any workaround in this case?

ianhe8x avatar Dec 18 '18 02:12 ianhe8x