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.

Asynchronous support?

See original GitHub issue

Not really sure how to figure out what is at fault but I figured this might be a decent spot to ask for advice:

This is the test file:

it('fails on purpose', function() {
  console.log('Expected failure');
  expect(true).toEqual(false);
});

it('fails without purpose (asynchronously)', function(done) {
  console.log('Unexpected failure');
  expect(true).toEqual(true);
  done();
});

Expected behaviour

1 failure, 1 success

Actual behaviour

2 failures, 0 success

with the following report:

18:28:11.675 spec.js:2 Expected failure
18:28:11.684 debug.js:15 FAILED  fails on purpose
18:28:11.684 spec.js:7 Unexpected failure
18:28:11.687 debug.js:21 Uncaught Expected true to equal false.
    at Object.<anonymous> (http://localhost:9876/base/spec.js:3:16)
(anonymous) @ debug.js:21
18:28:11.687 debug.js:15 FAILED  fails without purpose (asynchronously)
18:28:11.687 debug.js:6 Skipped 0 tests
18:28:11.688 debug.js:21 Uncaught Uncaught Expected true to equal false.
    at Object.<anonymous> (http://localhost:9876/base/spec.js:3:16) thrown
(anonymous) @ debug.js:21

Environment Details

  • webpack@2.5.0
  • karma@1.7.0
  • jasmine@2.7.0
  • karma-webpack@2.0.4
  • karma-jasmine@1.1.0

===

Jasmine keeps catching the thrown exception on all async specs. 😦 I’m not really sure if debug.js is set up correctly for asynchronous specs.

If I had multiple asynchronous spec, each would throw the previous uncaught exception.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
juancacommented, Aug 23, 2017

Repo set up @ https://github.com/juanca/karma-jasmine-async-bug

README contains SHAs which showcase how it works with just jasmine and how it works and does not work with karma/karma-jasmine.

Let me know if y’all need anything else.

1reaction
juancacommented, Aug 22, 2017

Yeah, it does work without karma.

I’ll post steps tomorrow since I’m not near a working computer today.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Synchronous vs. Asynchronous Support Channels
Asynchronous communication keeps track of the conversation and doesn't require the customer to start over because it never actually ends. A more ...
Read more >
How to Use Asynchronous Communication to Become a ...
5 Asynchronous Communication Tips to Improve Your Customer Support Skills · 1. Know Your Customers · 2. Don't Bite Off More Than You...
Read more >
The Ultimate Guide to Asynchronous Messaging - Freshworks
Asynchronous messaging is a way of live chat support that allows customers and businesses to interact in their own time without requiring ...
Read more >
Asynchronous support - Django documentation
Django has support for writing asynchronous (“async”) views, along with an entirely async-enabled request stack if you are running under ASGI.
Read more >
What Is Asynchronous Communication & How Do You Use It?
What is asynchronous communication? Here's how to collaborate effectively with your team and discover some asynchronous communication tools you can use.
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