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

possible to use min-document as minimal DOM? #7

Open
ahdinosaur opened this issue Oct 8, 2015 · 1 comment
Open

possible to use min-document as minimal DOM? #7

ahdinosaur opened this issue Oct 8, 2015 · 1 comment

Comments

@ahdinosaur
Copy link

hey, this seems like a really awesome module and keen to use it in a React project, thanks! 😄

this isn't hugely important, i'm mostly just curious: would it be possible to use min-document as the minimal DOM implementation? that way this module can focus on the core features of unit testing with React instead of having to roll its own minimal DOM (and all the nuances of that endeavour).

@pzavolinsky
Copy link
Owner

Hi @ahdinosaur this certainly looks like a cool idea. I'll try it in the next few days.

The actual DOM mock code in react-unit is only about 10 lines of js, since most of the heavy-lifting is mapping the React shallow render representation into something that resembles a DOM.

In any case using a real DOM library like min-document will probably make Sizzle happier than an ad-hoc mock an thus catch currently unsupported/unknown selectors.

Thanks for pointing me in this direction, I'll add more feedback in this issue after having played with min-document for a bit.

Cheers.

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

2 participants