question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TS2345 error: testIsolation not in cypress.d.ts -> TestConfigOverrides

See original GitHub issue

Current 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:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
rafal-pomocnik-captivateiqcommented, Sep 23, 2022

Cool, thanks @ZachJW34! I have some code prepared, but it seems I lack perms to push branch to remote - can you advise? 🙏

0reactions
cypress-bot[bot]commented, Nov 15, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found