TS2345 error: testIsolation not in cypress.d.ts -> TestConfigOverrides
See original GitHub issueCurrent behavior
When trying to use testIsolation
option in test suite at describe level like mentioned in https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests.html#Test-Isolation, typescript check marks it with below error:
TS2345: Argument of type '{ testIsolation: string; }' is not assignable to parameter of type 'TestConfigOverrides'. Object literal may only specify known properties, and 'testIsolation' does not exist in type 'TestConfigOverrides'.
Even though - it is working fine when testIsolation:'strict'
is added there and it utilizes this function properly.
Desired behavior
tsc
using cypress.d.ts
not complaining about it.
Test code to reproduce
// tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress", "node"]
},
"include": ["**/*.cy.ts"]
}
// test.cy.ts
describe('test name', { testIsolation: 'strict' }, () => {})
Cypress Version
10.8.0
Node version
v16.14.0
Operating System
macOS 12.6
Debug Logs
No response
Other
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
fix: testIsolation Typescript types #24603 - cypress-io ... - GitHub
Successfully merging this pull request may close these issues. TS2345 error: testIsolation not in cypress.d.ts -> TestConfigOverrides.
Read more >typescript error for cypress custom commands - Stack Overflow
I setup typescript for cypress. and try to setup as a docs,. But I cannot solve one ts error ( TS2345: Argument of...
Read more >Error Messages | Cypress Documentation
This message means that Cypress was unable to find tests in the specified file. You'll likely get this message if you have an...
Read more >cli/types/cypress.d.ts - Fossies
Member "cypress-12.1.0/cli/types/cypress.d.ts" (13 Dec 2022, ... test to prevent 902 * state from being shared across tests when test isolation is enabled.
Read more >@cypress/grep - npm
index.d.ts` currently extends the global Cypress types and // does not define `registerCypressGrep` so the import path is directly ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Cool, thanks @ZachJW34! I have some code prepared, but it seems I lack perms to push branch to remote - can you advise? 🙏
Released in
11.1.0
.This comment thread has been locked. If you are still experiencing this issue after upgrading to Cypress v11.1.0, please open a new issue.