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

[Bug]: Exported enums not working on tests #3397

Open
ibesora opened this issue Apr 5, 2022 · 15 comments
Open

[Bug]: Exported enums not working on tests #3397

ibesora opened this issue Apr 5, 2022 · 15 comments
Labels
🐛 Bug Confirmed Bug is confirmed

Comments

@ibesora
Copy link

ibesora commented Apr 5, 2022

Version

27.1.4

Steps to reproduce

Expected behavior

Tests should pass

Actual behavior

Tests fail with TypeError: Cannot read property 'Above' of undefined

Debug log

See it here
It was too long to add it here

Additional context

It seems to be a regression of #281
I can update the protomaps package if needed but it doesn't look like it's doing anything weird
Setting isolatedModules to false doesn't change anything

Environment

System:
    OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11980HK @ 2.60GHz
  Binaries:
    Node: 16.8.0 - ~/.asdf/installs/nodejs/16.8.0/bin/node
    Yarn: 1.22.15 - ~/.asdf/installs/nodejs/16.8.0/.npm/bin/yarn
    npm: 7.21.0 - ~/.asdf/plugins/nodejs/shims/npm
  npmPackages:
    jest: ^27.5.1 => 27.5.1
@ibesora
Copy link
Author

ibesora commented Apr 20, 2022

Hi, any update on this?

@ahnpnl
Copy link
Collaborator

ahnpnl commented Apr 23, 2022

We just noticed this while working on Jest 28 support, will try to fix this issue.

@ibesora
Copy link
Author

ibesora commented Jun 7, 2022

Any update on this? Can't test an important part of our app without this.
Thanks!

@kudryashov13
Copy link

Also facing the same issue, hope it will be fixed soon.

@OxyFlax
Copy link

OxyFlax commented Jul 1, 2022

@ibesora @kudryashov13 In case you didn't see, a way to tackle the issue while it's being fixed has been found here #281 (comment)

@mikerentmeister
Copy link

Please fix this, it's affecting our core testing functionality

@edwardfranco7
Copy link

Hey, any update on this one? I can confirm tests still fail using ts-jest v28.0.8 with jest v28.0.3 and v28.1.3.
Thank you!

@JoaquinEduardoArreguez
Copy link

I am facing the same problem on version 28.0.1, @ahnpnl is there any update on this?

@Smrtnyk
Copy link

Smrtnyk commented Sep 16, 2022

the protomaps does not do preserveContEnums in the tsconfig, so it is not preserved in the transpiled output
you can't import something that is not there

@ibesora
Copy link
Author

ibesora commented Sep 20, 2022

the protomaps does not do preserveContEnums in the tsconfig, so it is not preserved in the transpiled output
you can't import something that is not there

That doesn't seem to make a difference at all.

@PrashanthRyada
Copy link

Hey, any update on this?

@honghainguyen777
Copy link

I'm having the same problem. It could be a Circular imports issue. However, I am still trying my test to find or come up with a solution.

@rkuykendall
Copy link

@chce
Copy link

chce commented Oct 31, 2023

I've had success mocking the enum and returning an object instead.

@obrejla
Copy link

obrejla commented May 24, 2024

Hi guys, this is still problem...any news when it will be fixed?

"jest": "29.7.0",
"ts-jest": "29.1.2",

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

No branches or pull requests