Closed gilest closed 1 year ago
Self-reivew: I think we can reduce the configuration a bit here by disabling timers by default.
Edit: Yeah βΒ adjusted so that there's no installation config needed and the upgrading steps are simpler for most users (remove a single import).
@NullVoxPopuli please add breaking
Old world π
Previously the following was added to an Ember CLI app when installed via
ember install ember-cli-flash
.Essentially importing this helper would cause the
init
hook of theFlashObject
to become a no-op and disable the timeout running in consuming apps test runs.It wasn't very explicit or obvious that what was happening as a result of this import. Looking at apps that I maintain, some do and some don't have this...
New world π
Blueprints are not supported in V2 addons, so this PR ships two new test helpers instead.
To get the same behaviour as "Old world π " a consuming app needs only to remove the blueprint import. β
However this can be changed at any time with the
enableTimers
function. This allows consuming apps to choose on a per-test basis whether Flash timeouts should occur β as demonstrated by the included tests.Why not disable timeouts for all test runs? π€
There are many existing apps with test suites that both do and do not have timeouts disabled at present I think it's important that this is configurable for compatibility reasons.
Even this addon's own test suite tests with the timeout functionality enabled.
Other options π€·π»
Very open to suggestions here. Just wanted to have a known way forward to replace the existing blueprint.
Documentation