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.`;
357357 customElements . define ( 'custom-paragraph' , CustomParagraphElement , {
358358 extends : 'p' ,
359359 } ) ;
360+ customElements . define ( 'anonymous-element' , class extends HTMLElement { } ) ;
360361
361362 const parent = document . createElement ( 'div' ) ;
362363 parent . innerHTML = [
363364 '<custom-element></custom-element>' ,
364365 '<custom-extended-element></custom-extended-element>' ,
365366 '<p is="custom-paragraph"></p>' ,
367+ '<anonymous-element></anonymous-element>' ,
366368 ] . join ( '' ) ;
367369
368370 expect ( parent ) . toPrettyPrintTo (
@@ -373,6 +375,7 @@ Testing.`;
373375 ' <p' ,
374376 ' is="custom-paragraph"' ,
375377 ' />' ,
378+ ' <anonymous-element />' ,
376379 '</div>' ,
377380 ] . join ( '\n' ) ,
378381 ) ;
Original file line number Diff line number Diff line change @@ -31,9 +31,12 @@ const testHasAttribute = (val: any) => {
3131} ;
3232
3333const 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+ } ;
3740
3841const testNode = ( val : any ) => {
3942 const constructorName = val . constructor . name ;
You can’t perform that action at this time.
0 commit comments