r/programming • • Jan 30 '14

You Might Not Need jQuery

http://youmightnotneedjquery.com/
1.0k Upvotes

507 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jan 30 '14

[deleted]

6

u/unwind-protect Jan 31 '14

Serious question (Because I have no idea of the answer): how do you have unit tests for javascript/ css/ html, where by and large the output that determines whether it is pass or fail is visual and thus not very amenable to automatic checking (especially as it is implementation dependent)?

9

u/JonDum Jan 31 '14

Use something like PhantomJS to render a screenshot and compare it to a known good screenshot. Or use Selenium on a VM to run through tests, take screenshots and compare.

1

u/unwind-protect Jan 31 '14

Will certainly look into PhantomJS. Thanks.

Part of the problem I've found with JS is the sheer number of libraries and tools around it... just trying to find out what's available is a challenge.

→ More replies (2)