Skip to content

Instantly share code, notes, and snippets.

@lifeart
Created July 1, 2025 14:41
Show Gist options
  • Save lifeart/9eb68fe7080da7ba46bf8250b6c21239 to your computer and use it in GitHub Desktop.
Save lifeart/9eb68fe7080da7ba46bf8250b6c21239 to your computer and use it in GitHub Desktop.
Ember.js re-run initializers in qUnit tests
hooks.afterEach(async function () {
const base = this.owner['base'];
/*
* Reset container state to be able to run initializers again
*/
base.willDestroy();
base._booted = false;
base._initializersRan = false;
base._bootPromise = undefined;
base._readinessDeferrals = 1;
base.__registry__ = base.buildRegistry();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment