easy-fix
easy-fix copied to clipboard
Mutation of arguments between function call and resolution causes inconsistent callArgs
Let's say there is a function F(x) such that x is an object, and freturns a Promise. If inside of f, x is mutated, such as via x.a = 'blah', then the arguments that get serialized to the mock file will include a: "blah". Instead, the arguments to f should be snapshotted at the time that the function is called, and what is serialized to the mock file should not reflect later mutations.
https://github.com/walmartlabs/easy-fix/blob/master/index.js#L126