@@ -12,65 +12,65 @@ test('it change circular reference', t => {
12
12
t . is ( processing ( value ) , expected ) ;
13
13
} ) ;
14
14
15
- // test('it change first properties for @for', t => {
16
- // const expected = ':root{ --from: 1; } @for $i from 1 to 2';
17
- // const value = ':root{ --from: 1; } @for $i from var(--from) to 2';
18
- // t.is(processing(value), expected);
19
- // });
15
+ test ( 'it change first properties for @for' , t => {
16
+ const expected = ':root{ --from: 1; } @for $i from 1 to 2' ;
17
+ const value = ':root{ --from: 1; } @for $i from var(--from) to 2' ;
18
+ t . is ( processing ( value ) , expected ) ;
19
+ } ) ;
20
20
21
- // test('it change second properties for @for', t => {
22
- // const expected = ':root{ --to: 2; } @for $i from 1 to 2';
23
- // const value = ':root{ --to: 2; } @for $i from 1 to var(--to)';
24
- // t.is(processing(value), expected);
25
- // });
21
+ test ( 'it change second properties for @for' , t => {
22
+ const expected = ':root{ --to: 2; } @for $i from 1 to 2' ;
23
+ const value = ':root{ --to: 2; } @for $i from 1 to var(--to)' ;
24
+ t . is ( processing ( value ) , expected ) ;
25
+ } ) ;
26
26
27
- // test('it change two properties for @for', t => {
28
- // const expected = ':root{ --from: 1; --to: 2; } @for $i from 1 to 2';
29
- // const value = ':root{ --from: 1; --to: 2; } @for $i from var(--from) to var(--to)';
30
- // t.is(processing(value), expected);
31
- // });
27
+ test ( 'it change two properties for @for' , t => {
28
+ const expected = ':root{ --from: 1; --to: 2; } @for $i from 1 to 2' ;
29
+ const value = ':root{ --from: 1; --to: 2; } @for $i from var(--from) to var(--to)' ;
30
+ t . is ( processing ( value ) , expected ) ;
31
+ } ) ;
32
32
33
- // test('it change three properties for @for', t => {
34
- // const expected = ':root{ --from: 1; --to: 2; --step: 5 } @for $i from 1 to 2 by 5';
35
- // const value = ':root{ --from: 1; --to: 2; --step: 5 } @for $i from var(--from) to var(--to) by var(--step)';
36
- // t.is(processing(value), expected);
37
- // });
33
+ test ( 'it change three properties for @for' , t => {
34
+ const expected = ':root{ --from: 1; --to: 2; --step: 5 } @for $i from 1 to 2 by 5' ;
35
+ const value = ':root{ --from: 1; --to: 2; --step: 5 } @for $i from var(--from) to var(--to) by var(--step)' ;
36
+ t . is ( processing ( value ) , expected ) ;
37
+ } ) ;
38
38
39
- // test('it change two properties for @if', t => {
40
- // const expected = ':root{ --first: 1; --second: 2; } @if 1 < 2';
41
- // const value = ':root{ --first: 1; --second: 2; } @if var(--first) < var(--second)';
42
- // t.is(processing(value, {atRules: ['if']}), expected);
43
- // });
39
+ test ( 'it change two properties for @if' , t => {
40
+ const expected = ':root{ --first: 1; --second: 2; } @if 1 < 2' ;
41
+ const value = ':root{ --first: 1; --second: 2; } @if var(--first) < var(--second)' ;
42
+ t . is ( processing ( value , { atRules : [ 'if' ] } ) , expected ) ;
43
+ } ) ;
44
44
45
- // test('it change two properties for @if, @else if', t => {
46
- // const expected = ':root{ --first: 1; --second: 2; } @if 1 < 2 { color: olive; } @else if 1 > 2 { color: red; }';
47
- // const value = ':root{ --first: 1; --second: 2; } @if var(--first) < var(--second) { color: olive; } @else if var(--first) > var(--second) { color: red; }';
48
- // t.is(processing(value, {atRules: ['if', 'else']}), expected);
49
- // });
45
+ test ( 'it change two properties for @if, @else if' , t => {
46
+ const expected = ':root{ --first: 1; --second: 2; } @if 1 < 2 { color: olive; } @else if 1 > 2 { color: red; }' ;
47
+ const value = ':root{ --first: 1; --second: 2; } @if var(--first) < var(--second) { color: olive; } @else if var(--first) > var(--second) { color: red; }' ;
48
+ t . is ( processing ( value , { atRules : [ 'if' , 'else' ] } ) , expected ) ;
49
+ } ) ;
50
50
51
- // test('it change multi properties for @each', t => {
52
- // const expected = ':root{ --array: foo, bar, baz; } @each $val in foo, bar, baz {} @for foo, bar, baz {}';
53
- // const value = ':root{ --array: foo, bar, baz; } @each $val in var(--array) {} @for var(--array) {}';
54
- // t.is(processing(value, {atRules: ['each']}), expected);
55
- // });
51
+ test ( 'it change multi properties for @each' , t => {
52
+ const expected = ':root{ --array: foo, bar, baz; } @each $val in foo, bar, baz {} @for foo, bar, baz {}' ;
53
+ const value = ':root{ --array: foo, bar, baz; } @each $val in var(--array) {} @for var(--array) {}' ;
54
+ t . is ( processing ( value , { atRules : [ 'each' ] } ) , expected ) ;
55
+ } ) ;
56
56
57
- // test('it without variables', t => {
58
- // const expected = ':root{ --red: red; } @if var(--green) { color: var(--green) }';
59
- // const value = ':root{ --red: red; } @if var(--green) { color: var(--green) }';
60
- // t.is(processing(value), expected);
61
- // });
57
+ test ( 'it without variables' , t => {
58
+ const expected = ':root{ --red: red; } @if var(--green) { color: var(--green) }' ;
59
+ const value = ':root{ --red: red; } @if var(--green) { color: var(--green) }' ;
60
+ t . is ( processing ( value ) , expected ) ;
61
+ } ) ;
62
62
63
- // test('chould change from options variables', t => {
64
- // const expected = '@if green { .text-green { color: var(--green) }}';
65
- // const value = '@if var(--green) { .text-green { color: var(--green) }}';
66
- // const variables = {
67
- // '--green': 'green'
68
- // };
69
- // t.is(processing(value, {variables: variables}), expected);
70
- // });
63
+ test ( 'chould change from options variables' , t => {
64
+ const expected = '@if green { .text-green { color: var(--green) }}' ;
65
+ const value = '@if var(--green) { .text-green { color: var(--green) }}' ;
66
+ const variables = {
67
+ '--green' : 'green'
68
+ } ;
69
+ t . is ( processing ( value , { variables : variables } ) , expected ) ;
70
+ } ) ;
71
71
72
- // test('should change for @custom-media', t => {
73
- // const expected = ':root{ --breakpoint-xs: 29.25em } @custom -media --viewport-xs (width > 29.25em)';
74
- // const value = ':root{ --breakpoint-xs: 29.25em } @custom -media --viewport-xs (width > var(--breakpoint-xs))';
75
- // t.is(processing(value, {atRules: ['custom-media']}), expected);
76
- // });
72
+ test ( 'should change for @custom-media' , t => {
73
+ const expected = ':root{ --breakpoint-xs: 29.25em } @custom-media --viewport-xs (width > 29.25em)' ;
74
+ const value = ':root{ --breakpoint-xs: 29.25em } @custom-media --viewport-xs (width > var(--breakpoint-xs))' ;
75
+ t . is ( processing ( value , { atRules : [ 'custom-media' ] } ) , expected ) ;
76
+ } ) ;
0 commit comments