You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently test cases for the library are based on compile-time checks from static files. This will simply not work or scale well as the library and API grow. For example, tests already fail because the files don't reflect timeless legality (implemented in #8, which is good, this is a test problem not a problem with that PR).
Testing needs to be able to be done at runtime.
TypeScript can't really be assessed at runtime; types and interfaces do not exist at runtime and are exclusively a compile-time feature. The closest-match community project, ts-runtime, is 4 years old and never left the experimental v0.x stage.
Instead, I need to build a validator inside the library that (essentially) re-implements and tests the types against runtime data. That's a big ask but not necessarily unreasonable to do on reflection: it's reasonable for a type library to provide a validator, and I would be essentially dogfooding it in our libraries.
I want to maintain this library at having minimal dependencies. Right now we're at zero, which is pretty good. I could install yup for validation however, which itself has 4 dependencies, each of which has zero dependencies.
The text was updated successfully, but these errors were encountered:
Currently test cases for the library are based on compile-time checks from static files. This will simply not work or scale well as the library and API grow. For example, tests already fail because the files don't reflect timeless legality (implemented in #8, which is good, this is a test problem not a problem with that PR).
Testing needs to be able to be done at runtime.
TypeScript can't really be assessed at runtime; types and interfaces do not exist at runtime and are exclusively a compile-time feature. The closest-match community project, ts-runtime, is 4 years old and never left the experimental v0.x stage.
Instead, I need to build a validator inside the library that (essentially) re-implements and tests the types against runtime data. That's a big ask but not necessarily unreasonable to do on reflection: it's reasonable for a type library to provide a validator, and I would be essentially dogfooding it in our libraries.
I want to maintain this library at having minimal dependencies. Right now we're at zero, which is pretty good. I could install yup for validation however, which itself has 4 dependencies, each of which has zero dependencies.
The text was updated successfully, but these errors were encountered: