Jest test failing due to promise.withresolvers in pdfjs-dist
Closed this issue · 2 comments
deekusuma commented
I have angular project using ng2-pdf-viewer package. When writing unit tests in jest framework, I get Promise.WithResolvers is not a function pointing to code in pdfjs-dist. I have tried using different transformers but with no luck. Please help! (Screenshot below)
Bug Report or Feature Request (mark with an x
)
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [x] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
shamoon commented
We have an app that uses this package and a jest test suite of over 1000 tests, so I do not think this is an ng2-pdf-viewer bug. If whatever framework(s) you use don't provide this for you then you can polyfill it, e.g. vitest-dev/vitest#5512 (comment) but again, this is not a bug in this project and I would suggest this issue can be closed.