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 19, 2022
1 parent 1fb3a56 commit b7228cd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/docgen/test/get-type-annotation.js
Original file line number Diff line number Diff line change
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 b7228cd

Please sign in to comment.