Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix type clash between mocha and jest #6

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Conversation

danieldelcore
Copy link
Contributor

@danieldelcore danieldelcore commented Apr 8, 2020

Fixes a type clash between mocha and jest.

Both libraries share the same globals which clash: Thread

There appears to be a fix in the develop branch of Cypress which is currently unavailable.

There are two possible workarounds. The one i've provided narrows down the types and the alternate approach is to enable skipLibChecks which is less than ideal.

Related issues:

tsconfig.json Outdated
@@ -10,7 +10,8 @@
"forceConsistentCasingInFileNames": true,
"removeComments": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true
"allowSyntheticDefaultImports": true,
"types": ["jest"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this exclude every other library?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will exclude every other @type/* listed in package.json.

Alternatively we could list all type defs here or enable skipLibCheck which does the same thing as types: [] 😕

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be more clear, something like:

- "types": ["jest"],
+ "types": ["gzip-js", "jest", "react", "react-dom"],

Might be ideal, but would require every typedef to be listed here manually 😢

@danieldelcore danieldelcore force-pushed the cypress-ts-config branch 2 times, most recently from 0b28e35 to c86a8a4 Compare April 15, 2020 05:18
@alexreardon alexreardon merged commit 5296f53 into cypress Apr 15, 2020
@alexreardon alexreardon deleted the cypress-ts-config branch April 15, 2020 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants