Skip to content

Commit

Permalink
add stubbed out tests for cy-in-cy and correct documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
AtofStryker committed Jan 11, 2022
1 parent 336827f commit e4921c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/driver/cypress/integration/e2e/multi_domain_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,5 +316,9 @@ describe('multi-domain', { experimentalSessionSupport: true, experimentalMultiDo
it('propagates user defined secondary domain errors to the primary')

it('short circuits the secondary domain command queue when "done()" is called early')

it('does not have pending commands in the ui invoked from switchToDomain when tests passes')

it('does not have pending commands in the ui invoked from switchToDomain when tests fail')
})
})
5 changes: 3 additions & 2 deletions packages/driver/src/cy/multi-domain/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,11 @@ export function addCommands (Commands, Cypress: Cypress.Cypress, cy: Cypress.cy,
}

const doneAndCleanup = async (err) => {
// if done is called, immediately unbind commands, but wait for log updates to trickle in before invoking done
communicator.off('done:called', doneAndCleanup)

// if done is called, immediately unbind commands to prevent any commands from being enqueued, but wait for log updates to trickle in before invoking done
cleanupCommands()
await cleanupLogs()
communicator.off('done:called', doneAndCleanup)
done(err)
}

Expand Down

0 comments on commit e4921c2

Please sign in to comment.