forked from stylelint/stylelint
/
isScssVariable.test.js
36 lines (34 loc) · 1.08 KB
/
isScssVariable.test.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
'use strict';
const isScssVariable = require('../isScssVariable');
describe('isScssVariable', () => {
it('sass variable', () => {
expect(isScssVariable('$sass-variable')).toBeTruthy();
});
it('sass variable within namespace', () => {
expect(isScssVariable('namespace.$sass-variable')).toBeTruthy();
});
it('sass interpolation', () => {
expect(isScssVariable('#{$Attr}-color')).toBeFalsy();
});
it('single word property', () => {
expect(isScssVariable('top')).toBeFalsy();
});
it('hyphenated property', () => {
expect(isScssVariable('border-top-left-radius')).toBeFalsy();
});
it('property with vendor prefix', () => {
expect(isScssVariable('-webkit-appearance')).toBeFalsy();
});
it('custom property', () => {
expect(isScssVariable('--custom-property')).toBeFalsy();
});
it('less variable', () => {
expect(isScssVariable('@var')).toBeFalsy();
});
it('less append property value with comma', () => {
expect(isScssVariable('transform+')).toBeFalsy();
});
it('less append property value with space', () => {
expect(isScssVariable('transform+_')).toBeFalsy();
});
});