4 ms·
Actually this is a really good idea... But I was referring to to testing the CSS itself - in the same way I text my JavaScript. I'd love to have a suite of test
by blowski 10y ago
Actually this is a really good idea... But I was referring to to testing the CSS itself - in the same way I text my JavaScript. I'd love to have a suite of tests that say "this element should be 10px from the left of the page" or something like that. I've seen tools that attempt to make this possible but they are hard to work with.
Thanks for the suggestion on how to work with test classes anyway. Very useful.
- steveax 10y agoProbably the best way to test things like that is with a visual regression testing tool [1][2]. In practice these are difficult to get right and tend to produce a lot of false positives and negatives. See for instance Huxley [3] [1]: https://github.com/BBC-News/wraith https://github.com/BBC-News/wraith [2]: https://percy.io/ https://percy.io/ [3]: https://github.com/facebookarchive/huxley https://github.com/facebookarchive/huxley