typespec
                                
                                
                                
                                    typespec copied to clipboard
                            
                            
                            
                        [emitter-framework] Render discriminated unions correctly
This pull request enhances the handling of discriminated unions in the @typespec/emitter-framework package. It introduces new rendering logic for discriminated unions, updates existing components to support these changes, and improves test coverage to validate the new functionality.
Enhancements to discriminated union rendering:
- Added new rendering logic for discriminated unions, including support for "object" and "none" envelope styles, through the  
ObjectEnvelopeandNoneEnvelopefunctions inunion-expression.tsx. These handle different discriminator configurations and ensure proper rendering of union variants. [1] [2] 
Updates to existing components:
- Modified the 
InterfaceBodycomponent ininterface-declaration.tsxto include a semicolon when rendering type members, ensuring consistency with TypeScript syntax. Found in passing and validated via the new tests 
Improvements to test coverage:
- Refactored and expanded tests in 
union-declaration.test.tsxusing the new testing patterns 
Fixes #7174