question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

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 image

Additional context Working with Angular, Karma, Jasmine

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
jeremymengcommented, Nov 18, 2022

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. image

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.

2reactions
jeremymengcommented, Nov 17, 2022

@jeme95 thanks for sharing the project. I will have a look now.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found