Skip to content

Run settled before destroy()#1560

Open
NullVoxPopuli wants to merge 1 commit intomasterfrom
nvp/settled-before-destroy
Open

Run settled before destroy()#1560
NullVoxPopuli wants to merge 1 commit intomasterfrom
nvp/settled-before-destroy

Conversation

@NullVoxPopuli
Copy link
Copy Markdown
Collaborator

Situation:

  • have old code
  • do things in constructor instead of deriving data "on page load"
  • switch to @embroider/router
  • tests can sometimes fail now depending on execution order due to registerBundle being async (with waiters! (good)), but not all tests that call the aforementioned constructor are async, and thus wouldn't be doing anything with settled behavior anyway

Solution:

  • call await settled before destruction

{ waitForSettled = true }: TeardownContextOptions = {},
): Promise<void> {
return Promise.resolve()
.then(settled)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when does the argument waitForSettled get passed in as false, and when it does, wouldn't the new await of settled be unexpected?

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

Successfully merging this pull request may close these issues.

2 participants