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。