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

Need test coverage #6

Open
jfbrennan opened this issue Sep 8, 2020 · 4 comments
Open

Need test coverage #6

jfbrennan opened this issue Sep 8, 2020 · 4 comments

Comments

@jfbrennan
Copy link
Owner

Goal is 100% coverage

@1cg
Copy link

1cg commented Oct 23, 2020

htmx uses sinon and mocha/chai:

https://github.com/bigskysoftware/htmx/tree/master/test

And then mocha-chome for headless testing:

https://github.com/bigskysoftware/htmx/blob/938130040f13eeee55965a54bb8c9f722315d881/package.json#L24

not sure sinon is as useful for you, since htmx has to mock out AJAX

@JessicaSachs
Copy link

JessicaSachs commented Aug 10, 2021

👋🏻 I highly suggest using Cypress Component Testing. I'm the maintainer and I'm happy to help you out. Right now we have framework-specific bindings, but writing a wrapper for vanilla JS is about ~120 lines by leveraging @cypress/mount-utils.

Happy to publish it under Cypress's official namespace if you'd like to send me a PR or an isolated repository.

Cypress CT is a great solution for your a11y-focused library because we actually test in the web, and we have a lot of support for detecting if things are rendered vs visually hidden or clickable. There are things you simply cannot test with jest, etc.

Technically, you could think of it as "Mocha + Chrome", but with a driver that mimics usage more realistically than a programmatic .trigger('click') is able to do. Happy to chat in Discord.

@jfbrennan
Copy link
Owner Author

@JessicaSachs thanks for the suggestion. I like Cypress for e2e. I'll have to check out the ct stuff.

@jfbrennan
Copy link
Owner Author

@1cg was thinking jest, will have to go take a look at mocha-chrome. Thanks!

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

No branches or pull requests

3 participants