Skip to content

Commit

Permalink
Update tests to reflect relaxed type requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Jan 12, 2022
1 parent 7af07b4 commit 400f5ed
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/docgen/test/get-type-annotation.js
Expand Up @@ -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();
} );
} );

Expand Down

0 comments on commit 400f5ed

Please sign in to comment.