Closed Code-Quake closed 3 years ago
Hi @CobaltCoder, I believe some others have mentioned having issues with Jest, but I have not confirmed whether Jest is the actual culprit. If you could create minimal reproducible example repo, I'd be happy to look into it more.
I'm facing the same issue, I traced the error to copyProps
in utils.ts
, it happens when a non configurable props is tried to set into the dest, a work-around is:
export const copyProps = (dest: object, src: object, exclude: string[] = []) => {
const props = Object.getOwnPropertyDescriptors(src);
for (let prop of exclude) delete props[prop];
+ for (let propName in props) props[propName].configurable = true;
Object.defineProperties(dest, props);
};
I'm preparing a PR for this issue.
When I try to run a test on a class I've applied a mixin to I get this error: TypeError: Cannot redefine property: Symbol(Symbol.hasInstance) at Function.defineProperties ()
Any thoughts on how I can get around this?