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
I want to have strict type definition for meta object in order to set some properties only within given type boundaries and get utilize IDE suggestions to ease up writing test code
For example:
AndreyBelym
changed the title
Typescript: allow strict typing of test and fixture meta and ctx
Add an example that shows how to add more strict type checks for t.meta, ClientFunction.dependencies and so on
Nov 4, 2022
What is your Scenario?
I want to have strict type definition for meta object in order to set some properties only within given type boundaries and get utilize IDE suggestions to ease up writing test code
For example:
I want to enforce the type
target: 'staging' | 'local';
In addition I'd suggest similar for test/fixture
ctx
object as I'm setting some shared context properties inbefore
hookWhat are you suggesting?
I'm not sure what would be the best way to achieve that
Maybe expose generic
meta<T>(data: T)
functionsNo clue about best approach for
ctx
What alternatives have you considered?
I have to cast everywhere to benefit from static checks and suggestions
Additional context
No response
The text was updated successfully, but these errors were encountered: