File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
packages/pretty-format/src Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -357,12 +357,14 @@ Testing.`;
357
357
customElements . define ( 'custom-paragraph' , CustomParagraphElement , {
358
358
extends : 'p' ,
359
359
} ) ;
360
+ customElements . define ( 'anonymous-element' , class extends HTMLElement { } ) ;
360
361
361
362
const parent = document . createElement ( 'div' ) ;
362
363
parent . innerHTML = [
363
364
'<custom-element></custom-element>' ,
364
365
'<custom-extended-element></custom-extended-element>' ,
365
366
'<p is="custom-paragraph"></p>' ,
367
+ '<anonymous-element></anonymous-element>' ,
366
368
] . join ( '' ) ;
367
369
368
370
expect ( parent ) . toPrettyPrintTo (
@@ -373,6 +375,7 @@ Testing.`;
373
375
' <p' ,
374
376
' is="custom-paragraph"' ,
375
377
' />' ,
378
+ ' <anonymous-element />' ,
376
379
'</div>' ,
377
380
] . join ( '\n' ) ,
378
381
) ;
Original file line number Diff line number Diff line change @@ -31,9 +31,12 @@ const testHasAttribute = (val: any) => {
31
31
} ;
32
32
33
33
const isCustomElement = ( val : any ) => {
34
- const { tagName } = val
35
- return ( ( typeof tagName === 'string' && tagName . includes ( '-' ) ) || testHasAttribute ( val ) ) ;
36
- }
34
+ const { tagName} = val ;
35
+ return (
36
+ ( typeof tagName === 'string' && tagName . includes ( '-' ) ) ||
37
+ testHasAttribute ( val )
38
+ ) ;
39
+ } ;
37
40
38
41
const testNode = ( val : any ) => {
39
42
const constructorName = val . constructor . name ;
You can’t perform that action at this time.
0 commit comments