basarat / basarat/typescript-book

Execute synchronous code in the cypress command execution pipeline

Open
#444 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
21.6k
Forks
2.6k
PR merge metrics
No merged PRs in 30d

Description

`cy.then` is not the same as a promise then, so don't use it with [async/await](https://github.com/cypress-io/cypress/issues/1417).

The key usecase for `then` is to inject synchronous code *into* the cypress command execution pipeline.

e.g.

```ts
cy.something()
cy.then(()=>{
// This code will only execute after something is done.
})
```

Contributor guide

Open the contributing guide

Research direction

Start by reading the linked Cypress issue #1417 and the cy.then example in this issue. Confirm whether the requested change belongs in this TypeScript book or upstream in Cypress; the issue does not name a repository file, test, or acceptance criteria, so those need to be established before work can begin.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, typescript
Domain
documentation, testing
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.