index.test.js
1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
'use strict';
const assert = require('assert');
const isColorStop = require('..');
describe('is-color-stop', function () {
it('isColorStop', function () {
assert.ok(isColorStop('yellow'));
assert.ok(isColorStop('yellow', '12px'));
assert.ok(!isColorStop('yellow', 'px'));
assert.ok(isColorStop('yellow', 'calc(100%)'));
});
it('isColor', function () {
assert.ok(isColorStop.isColor('rgb(255, 255, 255)'));
});
it('isRGB', function () {
assert.ok(isColorStop.isRGB('rgb(255, 255, 255)'));
});
it('isRGBA', function () {
assert.ok(isColorStop.isRGBA('rgba(255, 255, 255, .9)'));
});
it('isHSL', function () {
assert.ok(isColorStop.isHSL('hsl(123, 45%, 67%)'));
});
it('isHSLA', function () {
assert.ok(isColorStop.isHSLA('hsla(123, 45%, 67%, .9)'));
});
it('isHex', function () {
assert.ok(isColorStop.isHex('#123456'));
});
it('isCSSColorName', function () {
assert.ok(isColorStop.isCSSColorName('yellow'));
});
it('isTransparent', function () {
assert.ok(isColorStop.isTransparent('transparent'));
});
it('isCSSLengthUnit', function () {
assert.ok(isColorStop.isCSSLengthUnit('px'));
});
});