Skip to content

Add flow type unit tests #1224

@leebyron

Description

@leebyron

It seems like there have been a few issues recently with flow types being broken, perhaps we should add some unit tests for them. Opening an issue to gauge interest, I'm happy to do the initial setup work if folks think this is worthwhile.

Here's what's involved:

We would add flow-bin as a devDependency and add a .flowconfig to the project, then add a file (or directory of files) that end in -test.js.flow. We would also add a small script that ran flow check on these files and pass if no errors were reported.

Flow has a feature where you can annotate portions of your code that you expect a type error, that instead cause a flow check to fail if they do not produce a type error. This provides a nice way to write both positive and negative tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions