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