chai-colors

用于 chai 的颜色断言。一个针对 onecolor 的薄包装器。

NPM version Build Status

比较不同的颜色表示

'rgba(0, 0, 0, 1)'.should.be.colored('#000000');

webdriver 结合使用,更有趣

browser
  .elementByCss('code .hljs-keyword')
  .getComputedCss('color').should.eventually.be.colored('mintcream')

安装

这是一个 Chai 断言库 的插件。通过 npm 安装。

npm install chai-colors

插件

像使用其他 Chai 插件一样使用此插件。

var chai = require('chai')
  , chaiColors = require('chai-colors');

chai.use(chaiColors);

支持的格式

参见 onecolor API