Giter VIP home page Giter VIP logo

Comments (4)

jfbrennan avatar jfbrennan commented on May 21, 2024 1

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

from m-.

1cg avatar 1cg commented on May 21, 2024

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

from m-.

JessicaSachs avatar JessicaSachs commented on May 21, 2024

👋🏻 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.

from m-.

jfbrennan avatar jfbrennan commented on May 21, 2024

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

from m-.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.