BackburnerJS / backburner.js

A rewrite of the Ember.js run loop as a generic microlibrary
MIT License
392 stars 80 forks source link

Missing test cases. #320

Open rwjblue opened 6 years ago

rwjblue commented 6 years ago

I did a quick skim of our test coverage and noticed a few holes where we need some coverage:

amk221 commented 3 years ago

I hope this is an OK place to put this, but perhaps an additional test might be needed for bb.join with no method:

// This is a stack trace from an Ember app where an async component action is being run, and the route is navigated away to another page during that time. I'm pretty sure there is no problem with the app code.

Uncaught (in promise) TypeError: Cannot read property 'apply' of undefined
    at Backburner._join (backburner.js:995)
    at Backburner.join (backburner.js:760)
    at Function.join (index.js:168)
    at Proxy.routeAction (route-action.js:53)
    at invokeAction (invoke-action.js:13)
    at runSearch (search.js:98)
    at SelectBox.search (index.js:327)
    at index.js:249
// backburner.js

_join(target, method, args) {
  if (this.currentInstance === null) {
    return this._run(target, method, args);
  }

  if (target === undefined && args === undefined) {
    return method();
  } else {
    return method.apply(target, args);  // `method` is undefined
  }
}
rwjblue commented 3 years ago

Ya, sounds good thanks @amk221!