-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
[@testing-library/cypress] New type definition #37692
[@testing-library/cypress] New type definition #37692
Conversation
@simjes Thank you for submitting this PR! Because this is a new definition, a DefinitelyTyped maintainer will be reviewing this PR in the next few days once the Travis CI build passes. In the meantime, if the build fails or a merge conflict occurs, I'll let you know. Have a nice day! |
👋 Hi there! I’ve run some quick performance metrics against master and your PR. This is still an experiment, so don’t panic if I say something crazy! I’m still learning how to interpret these metrics. Let’s review the numbers, shall we? These typings are for a package that doesn’t yet exist on master, so I don’t have anything to compare against yet! In the future, I’ll be able to compare PRs to testing-library__cypress with its source on master. Comparison details 📊
If you have any questions or comments about me, you can ping |
@johnnyreilly Could you have a look at it? :) |
@simjes do you have an example project of these working? I'm running into JQuery conflicts and I think it's because these new types import the latest version of |
@wKovacs64 check out https://github.com/simjes/cypress-testing-library-example. Had a question on the PR about the JQuery typings but it was merged without any feedback, so I assumed it was correct. |
@simjes I ran If it is indeed a |
My bad, getting the same errors. I'll look into it, any tips on how to best solve this @johnnyreilly? |
Not sure who else to ping on something like this. Maybe we should specify the JQuery version for now, so at least the migration path is possible? 🤔 |
{ | ||
"extends": "dtslint/dt.json", | ||
"rules": { | ||
"semicolon": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please open new PR removing all the rules here and fix errors. We do not want new definition with custom rules. If the rule is absolutely necessary disable it at the location, instead of for whole package, so we can review correctness of it.
} | ||
|
||
declare const Cypress: Cypress.Chainable | ||
export default Cypress |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be fixed asap. There is no default being exported here..
// a.js
const x = require("@testing-library/cypress");
console.log(x.default);
> node a.js
undefined
@simjes We want you to create a PR fixing the additional comments that are our principle guidelines for PRs. |
Also for the issue you are facing please try using cypress as the dependency in the types to see if that helps with the build errors |
@sheetalkamat thanks for the feedback, I will start fixing. |
That totally makes sense @sheetalkamat. Just it's not clear to me which principle guidelines for PRs that are being breached by this PR? I've looked at the guidance offered here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/.github/PULL_REQUEST_TEMPLATE.md And here: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/README.md#create-a-new-package But the points mentioned seem to be different to the ones you've been referencing. Have I missed something, or do these guidelines need updating with extra advice? |
Oh, depend on |
@sheetalkamat I've made some progress on this, but I'm getting typings error from cypress/jquery when running Do you have any suggestions? Maybe I should move this to stackoverflow or open a new issue instead? I've got a repo here if you would like to take a look. I've temporarly added The error:
|
@simjes That error is a Cypress issue and I think they need to update the version of |
This is related to testing-library/cypress-testing-library#68, moving typings to
DefinitelyTyped
.A couple of questions:
index.d.ts
? I was thinking I would need to add it topaths
intsconfig.json
, butnpm run test
will fail withIn JQuery, unexpected path mapping for JQuery: 'jquery'
.Any other feedback to improve this is appreciated
npm test
.)npm run lint package-name
(ortsc
if notslint.json
is present).Select one of these and delete the others:
If adding a new definition:
.d.ts
files generated via--declaration
dts-gen --dt
, not by basing it on an existing project. Inspired by other typings for testing-library__*tslint.json
should be present, andtsconfig.json
should havenoImplicitAny
,noImplicitThis
,strictNullChecks
, andstrictFunctionTypes
set totrue
.