import { massageSpec } from '../build-tools/massage-spec' ; import { schema } from '../lib' ; test ( 'dropTypelessAttributes works correctly' , ( ) => { const spec = { Fingerprint : 'some-fingerprint' , PropertyTypes : { 'CDK::Test::Property' : { Properties : { Type : ( { PrimitiveType : 'String' , } as schema . ScalarProperty ) , } , } , } , ResourceTypes : { 'CDK::Test::Resource' : { Attributes : { Attribute1 : ( { PrimitiveType : 'String' , } as schema . PrimitiveAttribute ) , Attribute2 : ( { } as schema . PrimitiveAttribute ) , } , Documentation : 'https://documentation-url/cdk/test/resource' , Properties : { ResourceArn : ( { PrimitiveType : 'String' , } as schema . PrimitiveProperty ) , } , } , } , } ; massageSpec ( spec ) ; expect ( spec ) . toEqual ( { Fingerprint : 'some-fingerprint' , PropertyTypes : { 'CDK::Test::Property' : { Properties : { Type : ( { PrimitiveType : 'String' , } as schema . ScalarProperty ) , } , } , } , ResourceTypes : { 'CDK::Test::Resource' : { Attributes : { Attribute1 : ( { PrimitiveType : 'String' , } ) , } , Documentation : 'https://documentation-url/cdk/test/resource' , Properties : { ResourceArn : { PrimitiveType : 'String' , } , } , } , } , } ) ; } ) ;