Skip to content

Commit 55c2629

Browse files
committed
Stateless Components: the final test?
1 parent 2b944a3 commit 55c2629

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/handlers/__tests__/propTypeHandler-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ describe('propTypeHandler', () => {
184184
);
185185
});
186186

187+
describe('stateless component', () => {
188+
test(
189+
propTypesSrc => template(`
190+
var Component = (props) => <div />;
191+
Component.propTypes = ${propTypesSrc};
192+
`),
193+
src => statement(src)
194+
);
195+
});
196+
187197
it('does not error if propTypes cannot be found', () => {
188198
var definition = expression('{fooBar: 42}');
189199
expect(() => propTypeHandler(documentation, definition))

0 commit comments

Comments
 (0)