chai-colors
用于 chai 的颜色断言。一个针对 onecolor 的薄包装器。
比较不同的颜色表示
'rgba(0, 0, 0, 1)'.should.be.colored('#000000');
与 webdriver 结合使用,更有趣
browser
.elementByCss('code .hljs-keyword')
.getComputedCss('color').should.eventually.be.colored('mintcream')
安装
npm install chai-colors
插件
像使用其他 Chai 插件一样使用此插件。
var chai = require('chai')
, chaiColors = require('chai-colors');
chai.use(chaiColors);
支持的格式
参见 onecolor API。