Open gregtatum opened 6 years ago
Hmm... actually never mind. I misspelled mapStateToProps
, and it didn't throw errors. Looking at the type definition, it makes sense why it wouldn't.
Reopening because I believe this is still something we need. It would give us more confidence when changing these complex typings as well as when upgrading flow.
Some key things from my previous research to do this:
suppress_comment
to .flowconfig
so that we have a more explicit comment than $FlowFixMe
for tests; maybe $ExpectError
is a good idea (like flow-typed
does). If we specify such a comment but there's no Flow error at this location, Flow will generate a warning.--max-warnings 0
when running Flow, so that warnings actually fail flow. (Note: this is new in Flow, before we had to parse Flow's output... Good we don't have to do that now :+1: )src/test/flow
to put the code samplesThings to especially check:
explicitConnect
(from src/utils/connect.js
)withSize
(from src/components/shared/WithSize.js
)withViewport
(from src/components/shared/chart/Viewport.js
)src/components/shared/ButtonWithPanel.js
)We have tests now for the connect.js function.
We should add some tests to make sure our typing works. My guess is that this broke in the recent Flow upgrade.
┆Issue is synchronized with this Jira Task