@@ -2,61 +2,61 @@ import { assert } from 'chai';
2
2
3
3
// You can import and use all API from the 'vscode' module
4
4
// as well as import your extension to test it
5
- import { HEXA_COLOR } from '../src/color-regex' ;
5
+ import { HEXA_COLOR } from '../src/color-regex' ;
6
6
import ColorUtil from '../src/color-util' ;
7
7
8
8
// Defines a Mocha test suite to group tests of similar kind together
9
- describe ( "Test CSS hexa shorthand color Regex" , ( ) => {
10
- it ( 'Should match color with only integer' , function ( ) {
11
- assert . ok ( '#000' . match ( HEXA_COLOR ) ) ;
12
- } ) ;
13
- it ( 'Should match color with letters and integers' , function ( ) {
14
- assert . ok ( '#f0a' . match ( HEXA_COLOR ) ) ;
15
- } ) ;
16
- it ( 'Should match color with only letters' , function ( ) {
17
- assert . ok ( '#fff' . match ( HEXA_COLOR ) ) ;
18
- } ) ;
19
- it ( 'Regex should not care about the case' , function ( ) {
20
- assert . ok ( '#Abc' . match ( HEXA_COLOR ) ) ;
21
- } ) ;
22
- it ( 'Should match with different characters at the end' , function ( ) {
23
- assert . ok ( '#Abc' . match ( HEXA_COLOR ) ) ;
24
- assert . ok ( '#Abc ' . match ( HEXA_COLOR ) ) ;
25
- assert . ok ( '#Abc,' . match ( HEXA_COLOR ) ) ;
26
- assert . ok ( '#Abc;' . match ( HEXA_COLOR ) ) ;
27
- assert . ok ( '#Abc\n' . match ( HEXA_COLOR ) ) ;
28
- } ) ;
29
- it ( 'Should not match' , function ( ) {
30
- assert . notOk ( '#AbG' . match ( HEXA_COLOR ) ) ;
31
- assert . notOk ( '#AbcG' . match ( HEXA_COLOR ) ) ;
32
- assert . notOk ( '#Ab' . match ( HEXA_COLOR ) ) ;
33
- } ) ;
34
- } ) ;
35
- describe ( "Test CSS hexa color Regex" , ( ) => {
36
- it ( 'Should match color with only integer' , function ( ) {
37
- assert . ok ( '#000000' . match ( HEXA_COLOR ) ) ;
38
- } ) ;
39
- it ( 'Should match color with letters and integers' , function ( ) {
40
- assert . ok ( '#f0f0f0' . match ( HEXA_COLOR ) ) ;
41
- } ) ;
42
- it ( 'Should match color with only letters' , function ( ) {
43
- assert . ok ( '#ffffff' . match ( HEXA_COLOR ) ) ;
44
- } ) ;
45
- it ( 'Regex should not care about the case' , function ( ) {
46
- assert . ok ( '#Abc012' . match ( HEXA_COLOR ) ) ;
47
- } ) ;
48
- it ( 'Should match with different characters at the end' , function ( ) {
49
- assert . ok ( '#ffffff ' . match ( HEXA_COLOR ) ) ;
50
- assert . ok ( '#ffffff,' . match ( HEXA_COLOR ) ) ;
51
- assert . ok ( '#ffffff;' . match ( HEXA_COLOR ) ) ;
52
- assert . ok ( '#ffffff\n' . match ( HEXA_COLOR ) ) ;
53
- } ) ;
54
- it ( 'Should not match' , function ( ) {
55
- assert . notOk ( '#fffffg' . match ( HEXA_COLOR ) ) ;
56
- assert . notOk ( '#ffffffg' . match ( HEXA_COLOR ) ) ;
57
- assert . notOk ( '#fffff' . match ( HEXA_COLOR ) ) ;
58
- } ) ;
59
- } ) ;
9
+ describe ( "Test CSS hexa shorthand color Regex" , ( ) => {
10
+ it ( 'Should match color with only integer' , function ( ) {
11
+ assert . ok ( '#000' . match ( HEXA_COLOR ) ) ;
12
+ } ) ;
13
+ it ( 'Should match color with letters and integers' , function ( ) {
14
+ assert . ok ( '#f0a' . match ( HEXA_COLOR ) ) ;
15
+ } ) ;
16
+ it ( 'Should match color with only letters' , function ( ) {
17
+ assert . ok ( '#fff' . match ( HEXA_COLOR ) ) ;
18
+ } ) ;
19
+ it ( 'Regex should not care about the case' , function ( ) {
20
+ assert . ok ( '#Abc' . match ( HEXA_COLOR ) ) ;
21
+ } ) ;
22
+ it ( 'Should match with different characters at the end' , function ( ) {
23
+ assert . ok ( '#Abc' . match ( HEXA_COLOR ) ) ;
24
+ assert . ok ( '#Abc ' . match ( HEXA_COLOR ) ) ;
25
+ assert . ok ( '#Abc,' . match ( HEXA_COLOR ) ) ;
26
+ assert . ok ( '#Abc;' . match ( HEXA_COLOR ) ) ;
27
+ assert . ok ( '#Abc\n' . match ( HEXA_COLOR ) ) ;
28
+ } ) ;
29
+ it ( 'Should not match' , function ( ) {
30
+ assert . notOk ( '#AbG' . match ( HEXA_COLOR ) ) ;
31
+ assert . notOk ( '#AbcG' . match ( HEXA_COLOR ) ) ;
32
+ assert . notOk ( '#Ab' . match ( HEXA_COLOR ) ) ;
33
+ } ) ;
34
+ } ) ;
35
+ describe ( "Test CSS hexa color Regex" , ( ) => {
36
+ it ( 'Should match color with only integer' , function ( ) {
37
+ assert . ok ( '#000000' . match ( HEXA_COLOR ) ) ;
38
+ } ) ;
39
+ it ( 'Should match color with letters and integers' , function ( ) {
40
+ assert . ok ( '#f0f0f0' . match ( HEXA_COLOR ) ) ;
41
+ } ) ;
42
+ it ( 'Should match color with only letters' , function ( ) {
43
+ assert . ok ( '#ffffff' . match ( HEXA_COLOR ) ) ;
44
+ } ) ;
45
+ it ( 'Regex should not care about the case' , function ( ) {
46
+ assert . ok ( '#Abc012' . match ( HEXA_COLOR ) ) ;
47
+ } ) ;
48
+ it ( 'Should match with different characters at the end' , function ( ) {
49
+ assert . ok ( '#ffffff ' . match ( HEXA_COLOR ) ) ;
50
+ assert . ok ( '#ffffff,' . match ( HEXA_COLOR ) ) ;
51
+ assert . ok ( '#ffffff;' . match ( HEXA_COLOR ) ) ;
52
+ assert . ok ( '#ffffff\n' . match ( HEXA_COLOR ) ) ;
53
+ } ) ;
54
+ it ( 'Should not match' , function ( ) {
55
+ assert . notOk ( '#fffffg' . match ( HEXA_COLOR ) ) ;
56
+ assert . notOk ( '#ffffffg' . match ( HEXA_COLOR ) ) ;
57
+ assert . notOk ( '#fffff' . match ( HEXA_COLOR ) ) ;
58
+ } ) ;
59
+ } ) ;
60
60
describe ( "Test CSS hexa shorthand color Regex" , ( ) => {
61
61
it ( 'Should match color with only integer' , function ( ) {
62
62
assert . ok ( '#000' . match ( HEXA_COLOR ) ) ;
@@ -120,7 +120,7 @@ describe('Test utility fonction', () => {
120
120
assert . equal ( ColorUtil . luminance ( '#000' ) , 0 , 'Should be "0" for #000' ) ;
121
121
assert . equal ( ColorUtil . luminance ( '#000000' ) , 0 , 'Should be "0" for #000000' ) ;
122
122
123
- assert . equal ( ColorUtil . luminance ( '#ccc' ) . toFixed ( 1 ) , 0.6 , 'Should be around "0.6" for #ccc' ) ;
124
-
123
+ assert . equal ( ColorUtil . luminance ( '#ccc' ) . toFixed ( 1 ) , 0.6 , 'Should be around "0.6" for #ccc' ) ;
124
+
125
125
} ) ;
126
126
} ) ;
0 commit comments