'Why is my Jest/Stencil test environment not working?

my npm version is 6.14.15

Now I want to run a simple Jest test. But I get following error: Test suite failed to run

TypeError: core_1.Component is not a function

But actually it happens with all Decorators. Like @Prop , @State , @Component etc.

So what I did for my unit test to work I just removed all these decorators from my .tsx File. And finally the unit test worked.(It pretends to run throught, but I have the feeling the test is doing nothing because if a change the expected value to nonsense it still gives me agreen check. It seems to stop in jest-intellij-util.js) Of course the unit test wouldn't need the prop etc anyway because unit test means test in isolation.

But yeah I really want to know how I can fix my test enviroment so it works even with decorators .

Thanks for your help!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source