Unexpected-color
This module extends the Unexpected assertion library with support for comparing colors via one.color.
expect('blue', 'to be colored', '#2233ff');
expected 'blue' to be colored '#2233ff'
#0000ff
#2233ff
How to use
Node
Install it with NPM or add it to your package.json
:
$ npm install knockout unexpected unexpected-color
Then:
var expect = require('unexpected').clone();
expect.installPlugin(require('unexpected-color'));
Browser
Include the unexpectedColor.min.js
found at the lib directory of this
repository after unexpected itself:
<script src="unexpected.js"></script>
<script src="unexpected-color.js"></script>
And then go on to install the plugin:
var expect = weknowhow.expect.clone();
expect.installPlugin(unexpectedColor);
RequireJS
Include the library with RequireJS the following way:
define(['unexpected', 'unexpected-color'], funtion (unexpected, unexpectedColor) {
var expect = unexpected.clone();
expect.installPlugin(unexpectedColor);
// Your code
});