Service Bus with Angular Testing
See original GitHub issue- azure/service-bus:
- 7.7.1:
- Windows 10:
- nodejs
- v16.16.0:
- browser
- Chrome Headless/107.0.5304.107:
- typescript
- 4.9.0-dev.20220917:
- Is the bug related to documentation in
- README.md
- source code documentation
- SDK API docs on https://docs.microsoft.com
Describe the bug
calling sender.sendMessages
in a unit test causes a timeout, but testing it manually in the browser works fine
To Reproduce
Run a unit test and call sender.sendMessages
in it
Expected behavior The message should be sent
Screenshots
Additional context Working with Angular, Karma, Jasmine
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
Testing services - Angular
Testing services with the TestBed link ... Your application relies on Angular dependency injection (DI) to create services. When a service has a...
Read more >Get started with Azure Service Bus queues (JavaScript)
This quick start provides step-by-step instructions for a simple scenario of sending messages to a Service Bus queue and receiving them.
Read more >Automated Front-End Unit Testing in Angular Framework (Part 1)
Discover Angular Testing and Automated Front-End Unit Testing in ... using spying to listen to the authentication service and always return ...
Read more >is there a way to receive messages from service bus from an ...
thx for your answer, yes we have an angular front and an asp.net core back, connected with many azure services and we apparently...
Read more >@azure/service-bus - npm
Azure Service Bus SDK for JavaScript. Latest version: 7.7.3, last published: 2 months ago. Start using @azure/service-bus in your project by ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I tried the repro and was able to see that at the beginning SDK works fine, websocket connection is established and transmitting data. However, after some handshake, code just stops running and eventually test times out.
I suspect when running in the jasmine/test environment, either promise is handled differently, or event are scheduled differently. I found some post about $rootScope.$digest, but haven’t been able to see whether it helps.
https://www.codesandnotes.be/2016/09/06/jasmine-test-on-angularjs-promise-returning-function-keeps-on-timing-out/
I will continue investigating.
@jeme95 thanks for sharing the project. I will have a look now.