Closed andrzej-woof closed 5 months ago
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:
fixture('Fixture'); test('Test', async () => {}).meta({ target: 'staging' });
I want to enforce the type target: 'staging' | 'local';
target: 'staging' | 'local';
In addition I'd suggest similar for test/fixture ctx object as I'm setting some shared context properties in before hook
ctx
before
I'm not sure what would be the best way to achieve that Maybe expose generic meta<T>(data: T) functions No clue about best approach for ctx
meta<T>(data: T)
I have to cast everywhere to benefit from static checks and suggestions
No response
@andrzej-kodify Thank you for the suggestion.
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)
functions No clue about best approach forctx
What alternatives have you considered?
I have to cast everywhere to benefit from static checks and suggestions
Additional context
No response