Comments (4)
So this is actually just running the flow-checking mechanism and then a [generic-test-framework] right after? looks nice, although I would definitely opt for tape
instead of mocha
, since it's much better isolated from the global environment...
from flow-typed.
So this is actually just running the flow-checking mechanism and then a [generic-test-framework] right after?
@ryyppy yea, that's right. The idea is to both confirm the validated types and give a means of confirming that the libdef matches the implementation as well.
from flow-typed.
I just made another thought about that... will this scale? When I imagine to run all tests and we need to install all npm dependencies for all libdefs just to run the tests, we will have first of all a huge install process and other than that a huge disk space waste just for developing some simple declarations...
Wouldn't it be better to tell lib-maintainers who commit stuff here to integrate the flow-tests process in their lib-tests themselves? Maybe give them some best-practise guidance for adding libdef testing via npm test
or so?
from flow-typed.
That's a good point with regard to the need to run all tests. We currently run all tests in travis on pull requests, but we really should only run tests for things that have changed. Once we're doing that, I think the speed will be manageable.
That said, running all tests is still useful sometimes (and is already slow), so perhaps the default behavior here should be that runtime tests only execute when a special flag is passed to run-tests
? That way you can just do static-check types independent of the runtime tests.
Wouldn't it be better to tell lib-maintainers who commit stuff here to integrate the flow-tests process in their lib-tests themselves?
This is generally not a bad idea, but I don't know how practical it is on a broad scale. In order to verify that a libdef matches the implementation you really do need a statically-typed consumer of the library (like a statically-typed test). While I would always encourage lib maintainers to write tests, it's also common to write tests in ways that are hard (if not impossible) to statically verify. Meta-programming is pretty common and useful in testing (think about dynamic test harnesses and data-dependent conditionals, etc).
Overall I think you might've convinced me that we should at least make these kinds of runtime tests optional since they could pose a lot more burden for writing a simple test than is necessary in some cases. Perhaps they're only useful when someone as a reason to be extra thorough with their libdefs.
from flow-typed.
Related Issues (20)
- @floating-ui/react
- rimraf is missing v4/5 HOT 1
- Workspace key is missing in the v4 docs
- Defintion koa-path-match
- Jest missing test case timeout HOT 2
- Dependency's dependency definitions should only consider `dependencies` HOT 1
- base-64
- add definition for body-scroll-lock-upgrade
- Add use-debounce definition
- [Question]: How to fix flowgen test after flow update HOT 1
- webpack v5 missing ProgressPlugin
- Jest support node api functions
- react-native loaded into test runner HOT 2
- use-debounced useDebounceCallback needs improvement
- body-scroll-lock-upgrade is declared wrong
- axios is missing signal property in config HOT 1
- new definition module-alias
- faker needs to add `person` from v8 onwards
- Add `worker_threads` to node environment
- Axios missing `instance.interceptors.request.clear()`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flow-typed.