@@ -62,48 +62,48 @@ describe('parse_declaration', () => {
6262 test ( 'simple declaration' , ( ) => {
6363 const node = parse_declaration ( 'color: red' )
6464 expect ( node . type ) . toBe ( DECLARATION )
65- expect ( node . name ) . toBe ( 'color' )
65+ expect ( node . property ) . toBe ( 'color' )
6666 expect ( node . first_child ! . text ) . toBe ( 'red' )
6767 expect ( node . is_important ) . toBe ( false )
6868 } )
6969
7070 test ( 'declaration with semicolon' , ( ) => {
7171 const node = parse_declaration ( 'color: red;' )
7272 expect ( node . type ) . toBe ( DECLARATION )
73- expect ( node . name ) . toBe ( 'color' )
73+ expect ( node . property ) . toBe ( 'color' )
7474 expect ( node . first_child ! . text ) . toBe ( 'red' )
7575 } )
7676
7777 test ( 'declaration without semicolon' , ( ) => {
7878 const node = parse_declaration ( 'color: red' )
7979 expect ( node . type ) . toBe ( DECLARATION )
80- expect ( node . name ) . toBe ( 'color' )
80+ expect ( node . property ) . toBe ( 'color' )
8181 expect ( node . first_child ! . text ) . toBe ( 'red' )
8282 } )
8383
8484 test ( 'declaration with whitespace variations' , ( ) => {
8585 const node = parse_declaration ( 'color : red' )
86- expect ( node . name ) . toBe ( 'color' )
86+ expect ( node . property ) . toBe ( 'color' )
8787 expect ( node . first_child ! . text ) . toBe ( 'red' )
8888 } )
8989
9090 test ( 'declaration with leading and trailing whitespace' , ( ) => {
9191 const node = parse_declaration ( ' color: red ' )
92- expect ( node . name ) . toBe ( 'color' )
92+ expect ( node . property ) . toBe ( 'color' )
9393 expect ( node . first_child ! . text ) . toBe ( 'red' )
9494 } )
9595
9696 test ( 'empty value' , ( ) => {
9797 const node = parse_declaration ( 'color:' )
98- expect ( node . name ) . toBe ( 'color' )
98+ expect ( node . property ) . toBe ( 'color' )
9999 // Empty values return null (consistent with main parser)
100100 expect ( node . first_child ! . text ) . toBe ( '' )
101101 expect ( node . first_child ! . children ) . toHaveLength ( 0 )
102102 } )
103103
104104 test ( 'empty value with semicolon' , ( ) => {
105105 const node = parse_declaration ( 'color:;' )
106- expect ( node . name ) . toBe ( 'color' )
106+ expect ( node . property ) . toBe ( 'color' )
107107 // Empty values return null (consistent with main parser)
108108 expect ( node . first_child ! . text ) . toBe ( '' )
109109 } )
@@ -112,28 +112,28 @@ describe('parse_declaration', () => {
112112 describe ( '!important Flag' , ( ) => {
113113 test ( 'declaration with !important' , ( ) => {
114114 const node = parse_declaration ( 'color: red !important' )
115- expect ( node . name ) . toBe ( 'color' )
115+ expect ( node . property ) . toBe ( 'color' )
116116 expect ( node . first_child ! . text ) . toBe ( 'red' )
117117 expect ( node . is_important ) . toBe ( true )
118118 } )
119119
120120 test ( 'declaration with !important and semicolon' , ( ) => {
121121 const node = parse_declaration ( 'color: red !important;' )
122- expect ( node . name ) . toBe ( 'color' )
122+ expect ( node . property ) . toBe ( 'color' )
123123 expect ( node . first_child ! . text ) . toBe ( 'red' )
124124 expect ( node . is_important ) . toBe ( true )
125125 } )
126126
127127 test ( 'historic !ie variant' , ( ) => {
128128 const node = parse_declaration ( 'color: red !ie' )
129- expect ( node . name ) . toBe ( 'color' )
129+ expect ( node . property ) . toBe ( 'color' )
130130 expect ( node . first_child ! . text ) . toBe ( 'red' )
131131 expect ( node . is_important ) . toBe ( true )
132132 } )
133133
134134 test ( 'any identifier after ! is treated as important' , ( ) => {
135135 const node = parse_declaration ( 'color: red !foo' )
136- expect ( node . name ) . toBe ( 'color' )
136+ expect ( node . property ) . toBe ( 'color' )
137137 expect ( node . first_child ! . text ) . toBe ( 'red' )
138138 expect ( node . is_important ) . toBe ( true )
139139 } )
@@ -147,37 +147,37 @@ describe('parse_declaration', () => {
147147 describe ( 'Vendor Prefixes' , ( ) => {
148148 test ( '-webkit- vendor prefix' , ( ) => {
149149 const node = parse_declaration ( '-webkit-transform: rotate(45deg)' )
150- expect ( node . name ) . toBe ( '-webkit-transform' )
150+ expect ( node . property ) . toBe ( '-webkit-transform' )
151151 expect ( node . is_vendor_prefixed ) . toBe ( true )
152152 } )
153153
154154 test ( '-moz- vendor prefix' , ( ) => {
155155 const node = parse_declaration ( '-moz-appearance: none' )
156- expect ( node . name ) . toBe ( '-moz-appearance' )
156+ expect ( node . property ) . toBe ( '-moz-appearance' )
157157 expect ( node . is_vendor_prefixed ) . toBe ( true )
158158 } )
159159
160160 test ( '-ms- vendor prefix' , ( ) => {
161161 const node = parse_declaration ( '-ms-filter: blur(5px)' )
162- expect ( node . name ) . toBe ( '-ms-filter' )
162+ expect ( node . property ) . toBe ( '-ms-filter' )
163163 expect ( node . is_vendor_prefixed ) . toBe ( true )
164164 } )
165165
166166 test ( '-o- vendor prefix' , ( ) => {
167167 const node = parse_declaration ( '-o-transition: all 0.3s' )
168- expect ( node . name ) . toBe ( '-o-transition' )
168+ expect ( node . property ) . toBe ( '-o-transition' )
169169 expect ( node . is_vendor_prefixed ) . toBe ( true )
170170 } )
171171
172172 test ( 'non-prefixed property' , ( ) => {
173173 const node = parse_declaration ( 'transform: rotate(45deg)' )
174- expect ( node . name ) . toBe ( 'transform' )
174+ expect ( node . property ) . toBe ( 'transform' )
175175 expect ( node . is_vendor_prefixed ) . toBe ( false )
176176 } )
177177
178178 test ( 'custom property is not vendor prefixed' , ( ) => {
179179 const node = parse_declaration ( '--custom-color: blue' )
180- expect ( node . name ) . toBe ( '--custom-color' )
180+ expect ( node . property ) . toBe ( '--custom-color' )
181181 expect ( node . is_vendor_prefixed ) . toBe ( false )
182182 } )
183183 } )
@@ -301,7 +301,7 @@ describe('parse_declaration', () => {
301301
302302 test ( 'property with colon but value with invalid token' , ( ) => {
303303 const node = parse_declaration ( 'color: red' )
304- expect ( node . name ) . toBe ( 'color' )
304+ expect ( node . property ) . toBe ( 'color' )
305305 expect ( node . first_child ! . text ) . toBe ( 'red' )
306306 } )
307307 } )
@@ -312,9 +312,9 @@ describe('parse_declaration', () => {
312312 expect ( node . type ) . toBe ( DECLARATION )
313313 } )
314314
315- test ( 'node.name returns property name' , ( ) => {
315+ test ( 'node.property returns property name' , ( ) => {
316316 const node = parse_declaration ( 'background-color: blue' )
317- expect ( node . name ) . toBe ( 'background-color' )
317+ expect ( node . property ) . toBe ( 'background-color' )
318318 } )
319319
320320 test ( 'node.value returns raw value string' , ( ) => {
0 commit comments