ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.51k stars 782 forks source link

Unit tests fail when component uses GSAP animation library #2851

Closed remjx closed 3 months ago

remjx commented 3 years ago

Stencil version:

 @stencil/core@2.4.0

I'm submitting a:

[x] bug report [ ] feature request [ ] support request

Current behavior: When running a unit test with a component that uses the GSAP animation library,

TypeError: Cannot read property 'setTimeout' of undefined

      at requestAnimationFrame (../node_modules/@stencil/core/mock-doc/index.cjs:3803:17)
      at _tick (../node_modules/gsap/dist/gsap.js:1190:24)
      at Object.wake (../node_modules/gsap/dist/gsap.js:1229:11)
      at _wake (../node_modules/gsap/dist/gsap.js:1259:38)
      at ../node_modules/gsap/dist/gsap.js:3564:5
      at ../node_modules/gsap/dist/gsap.js:2:66
      at Object.<anonymous> (../node_modules/gsap/dist/gsap.js:5:2)

Expected behavior: No error

Steps to reproduce: See this repo which is a minimal reproduction: https://github.com/remjx/stencil-gsap-unit-test-error It is simply the Stencil Component Starter, plus a simple animation added to the component.

Other information: This issue was previously reported and closed with a fix https://github.com/ionic-team/stencil/issues/1484 , but the issue has popped back up again

snaptopixel commented 3 years ago

@remjx did you ever find a workaround for this?

alicewriteswrongs commented 1 year ago

Hey all, thanks for filing this issue, and sorry that it took so long for someone from the Stencil team to get back to you!

Thanks for providing a reproduction case!

I just confirmed that this is still an issue in the latest version of Stencil. I'm going to label it for ingestion and prioritization in our internal backlog.

pimmesz commented 1 year ago

Any update on this? We cannot create any unit test now for our application due to this issue.

christian-bromann commented 3 months ago

Hi @remjx 👋

We apologize for the delay in addressing this issue. The StencilJS team has been hard at work, and we appreciate your patience.

As StencilJS has undergone significant updates and improvements since this issue was originally posted, we believe that this specific concern may no longer be relevant with the latest version. Therefore, we are closing this issue.

If you are still experiencing this problem or have any new issues, please feel free to open a new issue with the latest details, and we will be happy to assist you.

Thank you for your understanding and support of StencilJS!