Visitar URL original
2.1.0 version with node and jest mocking causes errors · Issue #145 · microsoft/tslib · GitHub
Skip to content

2.1.0 version with node and jest mocking causes errors #145

Open

Description

@jjm340

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions