Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX LTS] ensure “pause on exception” pauses in the right place #15600

Merged
merged 4 commits into from
Sep 21, 2017

Conversation

stefanpenner
Copy link
Member

It is quite common (like in ember-data’s tests) to not have a global onError handler in tests.
But because of the previous state of code, we would still end up paused in the default dispatchError rather then where the actual error was thrown.

This addresses the issue, but ensuring onErrorTarget.onerror returns undefined if no onError has been set

before:

screen shot 2017-08-25 at 6 15 44 am

After:

screen shot 2017-08-25 at 6 16 01 am

@@ -0,0 +1,66 @@
import Ember from 'ember';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should likely be moved to the packages/ember/tests folder, since it requires the global now.

@krisselden
Copy link
Contributor

    Failed assertion: TypeError: undefined is not an object (evaluating '_ember.default.Test.adapter')```

stefanpenner and others added 2 commits September 21, 2017 11:17
It is quite common (like in ember-data’s tests) to not have a global onError handler in tests.
But because of the previous state of code, we would still end up paused in the default dispatchError rather then where the actual error was thrown.

This addresses the issue, but ensuring onErrorTarget.onerror returns undefined if no onError has been set
The diff between [v1.1.0 and
v1.2.0](BackburnerJS/backburner.js@v1.1.0...v1.2.1)
includes the following changes:

* Allow `onError` to be late bound (and recalculated for each flush).
* Make `now()` late bound (allowing for things like
  `sinon.useFakeTimers()`).
@rwjblue
Copy link
Member

rwjblue commented Sep 21, 2017

Updated:

  • rebase
  • update backburner.js to 1.2.1 (to include other fixes required)
  • fix tests that were previously throwing errors that were swallowed in production
  • fix test that was clobbering backburner._platform

I tested both prod and debug builds before pushing, so now we just have to convince sauce labs 😈 ...

Previously, this test assumed that the only value on
`backburner._platform` that was required was `setTimeout`.  As of
Backburner 1.2.1 this is no longer true (it also requires `.now()`), and
really should not have been assumed to begin with.

This change simply ensures that `backburner._platform` continues to have
all the same methods on it, but uses the test override of `setTimeout`
to run its assertions.
Previously, due to always running within a try/catch these errors were
swallowed in production build test runs.
@rwjblue rwjblue merged commit 04b6f42 into master Sep 21, 2017
@rwjblue rwjblue deleted the improve-test-debugging branch September 21, 2017 20:23
@stefanpenner
Copy link
Member Author

thanks @rwjblue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants