Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flow type unit tests #1224

Closed
leebyron opened this issue Feb 3, 2017 · 2 comments · Fixed by #1230 or singapore/gl-got#13
Closed

Add flow type unit tests #1224

leebyron opened this issue Feb 3, 2017 · 2 comments · Fixed by #1230 or singapore/gl-got#13

Comments

@leebyron
Copy link
Contributor

leebyron commented Feb 3, 2017

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.

@leebyron
Copy link
Contributor Author

leebyron commented Feb 3, 2017

cc @bookercodes @sindresorhus

@sindresorhus
Copy link
Member

👍 Good idea! A pull request would be lovely :)

leebyron added a commit to leebyron/ava that referenced this issue Feb 5, 2017
Closes avajs#1224

This adds flow-bin, adds it to the test running script, and adds some regression tests based on prior issues.

In an immediate proof of value (and proof of my own prior sloppiness) it spotted an issue that avajs#1219 sought to fix and did not do so. Fix included along with test.
leebyron added a commit to leebyron/ava that referenced this issue Feb 6, 2017
Closes avajs#1224

This adds flow-bin, adds it to the test running script, and adds some regression tests based on prior issues.

In an immediate proof of value (and proof of my own prior sloppiness) it spotted an issue that avajs#1219 sought to fix and did not do so. Fix included along with test.
sotojuan pushed a commit that referenced this issue Feb 6, 2017
Closes #1224.

This adds flow-bin, adds it to the test running script, and adds some regression tests based on prior issues.

In an immediate proof of value (and proof of my own prior sloppiness) it spotted an issue that #1219 sought to fix and did not do so. Fix included along with test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants