Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.1.0 version with node and jest mocking causes errors #145

Open
jjm340 opened this issue Jan 25, 2021 · 0 comments
Open

2.1.0 version with node and jest mocking causes errors #145

jjm340 opened this issue Jan 25, 2021 · 0 comments

Comments

@jjm340
Copy link

jjm340 commented Jan 25, 2021

When upgrading to the newest versions of tslib, typescript, and jest I received the following error in an existing project:

TypeError: Cannot redefine property: upsertThing
        at Function.defineProperty (<anonymous>)
 jest.spyOn(transactionDomain, 'upsertThing');

upsertThing is a function exported from it's own file, then again exported from an index file via export *.... When jest tries to spy on it, this error is thrown with version 2.1.0 of tslib. But when I downgrade to tslib 1.14.1 the error goes away.

Version Info:
Node: Tried on both 12 and 14
jest: 26.6.3
ts-jest: 26.4.4
ts-node: 9.1.1
typescript: 4.1.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant