ember-concurrency icon indicating copy to clipboard operation
ember-concurrency copied to clipboard

Docs recommend using a private Ember API for test cleanup

Open runspired opened this issue 2 years ago • 3 comments

Ember.run.cancelTimers is not a public API but is recommended here: https://ember-concurrency.com/docs/testing-debugging

It's not even documented as a private API: https://api.emberjs.com/ember/release/modules/@ember%2Frunloop Nor is it documented as part of Backburner's API https://github.com/BackburnerJS/backburner.js/tree/master

runspired avatar Apr 14 '23 20:04 runspired

@machty could we expose a test helper instead for this that would do something similar?

RobbieTheWagner avatar Apr 18 '23 18:04 RobbieTheWagner

I'm not sure what to recommend here; I don't think EC is alone in recommending use of cancelTimers, and lots of folk doing custom long-polling solutions are probably using cancelTimers. If there is some community convention surrounding this, I'm happy to recommend it.

machty avatar Apr 18 '23 19:04 machty

Using run.foo is deprecated, and since this is not public API, I think we should probably at least wrap it in a test helper or something. Not sure if that shields us properly from the deprecation or not.

RobbieTheWagner avatar Apr 24 '23 14:04 RobbieTheWagner