basarat / basarat/typescript-book
Execute synchronous code in the cypress command execution pipeline
- 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
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