CARVIEW |
Select Language
HTTP/2 200
server: GitHub.com
content-type: text/html; charset=utf-8
last-modified: Thu, 25 Aug 2016 22:10:49 GMT
access-control-allow-origin: *
etag: W/"57bf6ce9-1db8"
expires: Sun, 12 Oct 2025 02:59:32 GMT
cache-control: max-age=600
content-encoding: gzip
x-proxy-cache: MISS
x-github-request-id: 8F79:135D5D:D93B0:10E781:68EB173A
accept-ranges: bytes
age: 0
date: Sun, 12 Oct 2025 02:49:32 GMT
via: 1.1 varnish
x-served-by: cache-bom-vanm7210088-BOM
x-cache: MISS
x-cache-hits: 0
x-timer: S1760237372.109060,VS0,VE301
vary: Accept-Encoding
x-fastly-request-id: 664f2de18ef91111e8e93e7adf71a747276e51ec
content-length: 1992
unexpected-color
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
});