Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,21 @@ import 'cypress-if'

### Types

Types for the `.if()` and `.else()` commands are described in the include typescript file [src/index.d.ts](./src/index.d.ts) file. If you need intellisense, include the type for this package. For example,
Types for the `.if()` and `.else()` commands are described in the include typescript file [src/index.d.ts](./src/index.d.ts) file. If you need intellisense, include the type for this package in your `tscofig.json`

```jsonc
"compilerOptions": {
"types": [
"cypress",
"cypress-if" // add this line
]
}
```

For JavaScript projects that cannot use `tsconfig.json` or `jscofig.json`, the special comment might do the trick:

```js
// your spec file
// your spec file "cypress/e2e/spec.cy.js" add this comment
/// <reference types="cypress-if" />
```

Expand Down