CSS unit and integration testing
npm install quixoteQuixote is a library for testing CSS. It's fast—over 100 tests/second—and has a powerful API. You can use it for unit testing (test your CSS files directly) or integration testing (test against a real server). Either way, your tests check how HTML elements are actually rendered by the browser.
Quixote is unique for its ability to test how elements relate to each other. For example, you can test if one element is below another element, or how an element compares to the browser's viewport.
Example test:
``javascript
// 'frame' is the Quixote test frame. See below for complete examples.
var header = frame.get("#header");
var navbar = frame.get(".navbar");
navbar.top.should.equal(header.bottom); // the navbar is immediately below the header
navbar.width.should.equal(frame.viewport().width); // the navbar is exactly as wide as the viewport
`
Example output:
``
top edge of '.navbar' should be 13px higher.
Expected: 50px (bottom edge of '#header')
But was: 63px
Quixote runs in the browser and works with any test framework. You can even test multiple browsers simultaneously by using a tool such as Karma or Test'em. It works in modern desktop browsers, mobile browsers, and IE 8+.
* API Documentation
* Complete Example
* Browsers Tested for This Release
* Change Log
* Roadmap
* Contributing
* License (MIT)
`sh`
$ npm install quixote
Or download dist/quixote.js.
Quixote is a UMD module, which means it will work with CommonJS and AMD module loaders. If you just load the file using a