-
Notifications
You must be signed in to change notification settings - Fork 92
/
index.js
125 lines (122 loc) · 2.29 KB
/
index.js
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
import rule, { messages, ruleName } from "..";
testRule(rule, {
ruleName,
config: ["always"],
syntax: "scss",
accept: [
{
code: `
$test: ("foo": 14px, "bar": 25px);
`,
description: "accepts strings without quotes"
},
{
code: `
$test: ('foo': 14px, 'bar': 25px);
`,
description: "accepts strings with quotes"
},
{
code: `
$colors: (
250: #eef9ff,
300: #bbe7ff,
350: #b7d3e6,
500: #1388db,
750: #0f6bac,
900: #2e4662
);
`,
description: "accepts numbers"
},
{
code: `
$colors: (
'primary': (
250: #eef9ff,
300: #bbe7ff,
350: #b7d3e6,
500: #1388db,
750: #0f6bac,
900: #2e4662,
)
);
`,
description: "accepts numbers (nested)"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable * 2,
);
`,
description: "accepts * operator inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable*2,
);
`,
description: "accepts * operator without spaces inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable - 2,
);
`,
description: "accepts - operator inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable + 2,
);
`,
description: "accepts + operator inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable / 2,
);
`,
description: "accepts / operator inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": $variable % 2,
);
`,
description: "accepts % operator inside a value"
},
{
code: `
$map: (
"key-one": 0,
"key-two": (1+2),
);
`,
description: "accepts parens inside a value"
}
],
reject: [
{
code: `
$test: (Helvetica: 25px, Arial: 50px)
`,
message: messages.expected,
description:
"does not accept variables representing strings that are quoted.",
location: 1
}
]
});