@@ -77,15 +77,13 @@ describe('attributeValueToTypedAttributeValue', () => {
7777 } ) ;
7878
7979 describe ( 'homogeneous primitive arrays' , ( ) => {
80- it . each ( [
81- [ [ 'foo' , 'bar' ] ] ,
82- [ [ 1 , 2 , 3 ] ] ,
83- [ [ true , false , true ] ] ,
84- [ [ ] as unknown [ ] ] ,
85- ] ) ( 'emits a typed array attribute for raw value %j' , value => {
86- const result = attributeValueToTypedAttributeValue ( value ) ;
87- expect ( result ) . toStrictEqual ( { value, type : 'array' } ) ;
88- } ) ;
80+ it . each ( [ [ [ 'foo' , 'bar' ] ] , [ [ 1 , 2 , 3 ] ] , [ [ true , false , true ] ] , [ [ ] as unknown [ ] ] ] ) (
81+ 'emits a typed array attribute for raw value %j' ,
82+ value => {
83+ const result = attributeValueToTypedAttributeValue ( value ) ;
84+ expect ( result ) . toStrictEqual ( { value, type : 'array' } ) ;
85+ } ,
86+ ) ;
8987
9088 it ( 'emits a typed array attribute for attribute object values' , ( ) => {
9189 const result = attributeValueToTypedAttributeValue ( { value : [ 'foo' , 'bar' ] } ) ;
@@ -94,25 +92,21 @@ describe('attributeValueToTypedAttributeValue', () => {
9492 } ) ;
9593
9694 describe ( 'invalid values (non-primitives)' , ( ) => {
97- it . each ( [
98- [ [ 1 , 'foo' , true ] ] ,
99- [ { foo : 'bar' } ] ,
100- [ ( ) => 'test' ] ,
101- [ Symbol ( 'test' ) ] ,
102- ] ) ( 'returns undefined for non-primitive raw values (%s)' , value => {
103- const result = attributeValueToTypedAttributeValue ( value ) ;
104- expect ( result ) . toBeUndefined ( ) ;
105- } ) ;
95+ it . each ( [ [ [ 1 , 'foo' , true ] ] , [ { foo : 'bar' } ] , [ ( ) => 'test' ] , [ Symbol ( 'test' ) ] ] ) (
96+ 'returns undefined for non-primitive raw values (%s)' ,
97+ value => {
98+ const result = attributeValueToTypedAttributeValue ( value ) ;
99+ expect ( result ) . toBeUndefined ( ) ;
100+ } ,
101+ ) ;
106102
107- it . each ( [
108- [ [ 1 , 'foo' , true ] ] ,
109- [ { foo : 'bar' } ] ,
110- [ ( ) => 'test' ] ,
111- [ Symbol ( 'test' ) ] ,
112- ] ) ( 'returns undefined for non-primitive attribute object values (%s)' , value => {
113- const result = attributeValueToTypedAttributeValue ( { value } ) ;
114- expect ( result ) . toBeUndefined ( ) ;
115- } ) ;
103+ it . each ( [ [ [ 1 , 'foo' , true ] ] , [ { foo : 'bar' } ] , [ ( ) => 'test' ] , [ Symbol ( 'test' ) ] ] ) (
104+ 'returns undefined for non-primitive attribute object values (%s)' ,
105+ value => {
106+ const result = attributeValueToTypedAttributeValue ( { value } ) ;
107+ expect ( result ) . toBeUndefined ( ) ;
108+ } ,
109+ ) ;
116110 } ) ;
117111 } ) ;
118112
0 commit comments