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(TS): Cypress commands return jQuery objects #56

Merged
merged 1 commit into from
Jun 24, 2019

Conversation

aaronmcadam
Copy link
Collaborator

@aaronmcadam aaronmcadam commented Jun 20, 2019

Without this fix, the types are wrong using methods like invoke or using callbacks on commands.

Fixes #39.

Supercedes #40.

Thanks to @simenbrekken for doing the initial work on this!

Checklist:

  • Documentation
  • Tests
  • Ready to be merged

@aaronmcadam
Copy link
Collaborator Author

aaronmcadam commented Jun 20, 2019

Do we need users to install the jQuery types on their own projects?

@aaronmcadam
Copy link
Collaborator Author

Travis is failing because of a Cypress dependency:

[test] /home/travis/.cache/Cypress/3.3.1/Cypress/Cypress: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory

@kentcdodds
Copy link
Member

I'll give this a look next week :-) thank you so much!

kentcdodds
kentcdodds previously approved these changes Jun 24, 2019
Copy link
Member

@kentcdodds kentcdodds left a comment

Choose a reason for hiding this comment

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

I'm not using these types on any project currently, so even though this looks fine to me, I can't verify that it's correct. But I'm willing to take your word for it if you're willing to fix any bugs that people come up with upon its release 😅

expect(el.play).to.exist
}
})
test('includes proper TypeScript types', () => {
Copy link
Member

Choose a reason for hiding this comment

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

Does cypress support the test global? 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point! It uses Mocha, not Jest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ah it looks like Mocha supports it, according to its types.

@kentcdodds
Copy link
Member

I think this is the solution: cypress-io/cypress#4069

I'll go ahead and fix this in master right now.

@aaronmcadam
Copy link
Collaborator Author

if you're willing to fix any bugs

Hi @kentcdodds! Thanks for the review! Yeah, I'm willing to get this fixed up as issues are raised.

@aaronmcadam
Copy link
Collaborator Author

@kentcdodds I'll update the readme when I know if we require users to do anything extra.

@kentcdodds
Copy link
Member

Sorry, I just introduced a merge conflict because that snapshot file was nothing but pain so I removed it. Could you rebase? Then I think we should be ready to go.

Without this fix, the types are wrong using methods like `invoke` or using callbacks on commands.
@aaronmcadam
Copy link
Collaborator Author

snapshot file was nothing but pain

Yeah I've been removing snapshots in my projects too!

I've just rebased and pushed

@kentcdodds kentcdodds merged commit a375930 into master Jun 24, 2019
@kentcdodds kentcdodds deleted the am-update-typescript-types branch June 24, 2019 15:20
@kentcdodds
Copy link
Member

@all-contributors please add @aaronmcadam for code and tests

@allcontributors
Copy link
Contributor

@kentcdodds

I've put up a pull request to add @aaronmcadam! 🎉

@kentcdodds
Copy link
Member

🎉 This PR is included in version 4.0.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect TypeScript return types from commands
2 participants