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

Unclear how to use with Node #1

Open
marcysutton opened this issue Jul 9, 2018 · 5 comments
Open

Unclear how to use with Node #1

marcysutton opened this issue Jul 9, 2018 · 5 comments

Comments

@marcysutton
Copy link

In environments where there is no document object (like in Node.js), this utility doesn't work by itself. You have to specify a document somehow, so it would be good to tell people how to do that. It would be super useful for asserting strings of HTML are output correctly using Node.js as a simple build and test pipeline.

@danawoodman
Copy link
Owner

This is designed for a browser environment. How would you propose rendering in a node environment? What would the document be?

@marcysutton
Copy link
Author

It might be worth adding some details that this project is in fact designed for a browser environment.

In Node we sometimes use JSDOM and jsdom-global to play around with the document object. I was looking for a unit testing tool to take an HTML string and convert it to DOM objects so I could assert qualities about them, but I didn't have a browser instance as my Node utility is for outputting plain HTML fixtures. I'll likely just create some integration tests instead and stand them up in a browser.

@danawoodman
Copy link
Owner

This would work if you had JSDOM since I use it wil JSDOM. Are you saying it doesn't work with JSDOM?

@marcysutton
Copy link
Author

I'm saying you should add a note that the tool expects a browser environment, and that people can use JSDOM or headless Chrome to accomplish that task. It might save someone time in the future.

@danawoodman
Copy link
Owner

@marcysutton a Pull Request would be much appreciated 😄

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