From b7228cdca1b52276048d25a645e7a162e9c781f5 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Wed, 12 Jan 2022 17:40:40 -0500 Subject: [PATCH] Update tests to reflect relaxed type requirement --- packages/docgen/test/get-type-annotation.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/docgen/test/get-type-annotation.js b/packages/docgen/test/get-type-annotation.js index 431dfb611f5d2..a32acd875a9b8 100644 --- a/packages/docgen/test/get-type-annotation.js +++ b/packages/docgen/test/get-type-annotation.js @@ -196,16 +196,12 @@ describe( 'Type annotations', () => { describe( 'missing types', () => { const node = getMissingTypesNode(); - it( 'should throw an error if there is no return type', () => { - expect( () => getTypeAnnotation( returnTag, node, 0 ) ).toThrow( - "Could not find return type for function 'fn'." - ); + it( 'should return null if there is no return type', () => { + expect( getTypeAnnotation( returnTag, node, 0 ) ).toBeNull(); } ); - it( 'should throw an error if there is no param type', () => { - expect( () => getTypeAnnotation( paramTag, node, 0 ) ).toThrow( - "Could not find type for parameter 'foo' in function 'fn'." - ); + it( 'should return null if there is no param type', () => { + expect( getTypeAnnotation( paramTag, node, 0 ) ).toBeNull(); } ); } );