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

Missing test cases. #320

Open
rwjblue opened this issue Jan 22, 2018 · 2 comments
Open

Missing test cases. #320

rwjblue opened this issue Jan 22, 2018 · 2 comments

Comments

@rwjblue
Copy link
Collaborator

rwjblue commented Jan 22, 2018

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

  • bb.defer is untested (yes, it is deprecated, but it should still have a test given that it is public API)
  • Error conditions in bb.on and bb.off are not tested (passing no eventName, or passing no callback)
  • end called without begin error thrown in bb.end() is not tested
  • invoking bb.later() e.g. with no arguments. This should be an error IMHO, but currently just returns early
  • bb.ensureInstance() is public API that has no tests
  • bb.join(function() { }) (no target or args) when within a run-loop (e.g. when we are actually joining an existing loop) has no tests
  • bb.join(function() { }, someArg) (no target with args) when within a run-loop (e.g. when we are actually joining an existing loop) has no tests
  • } else { end = middle; } in binary-search has no tests
  • Queue.prototype.flush with a custom before / after has no tests
@amk221
Copy link

amk221 commented Feb 24, 2021

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
Copy link
Collaborator Author

rwjblue commented Feb 26, 2021

Ya, sounds good thanks @amk221!

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

No branches or pull requests

2 participants