Closed htho closed 1 month ago
Hello,
Could you please try using the following example - it shows how to type check Metadata?
https://github.com/DevExpress/testcafe-examples/tree/master/examples/type-check-for-meta
I look forward to your results.
Hi,
no, this does not help, because it does not show errors when wrong metadata is set (except if the generic overload is enforced - test.meta<MetaOptions>
).
But only overloading TestFn
is not enough, because I want typesafety for all places where Metadata
is used: FixtureFn
, TestInfo
, FixtureInfo
, FilterFunction
, FilterDescriptor
We appreciate you taking the time to share information about this issue. We reproduced the bug and added this ticket to our internal task queue. We'll update this thread once we have news.
What is your Scenario?
I want type safety when I use metadata. Therefore I want to declare the shape of the
Metadata
type.What are you suggesting?
This would be possible if
Metadata
was not defined as atype
but as aninterface
in./ts-defs-src/test-api/test-info.d.ts
.This way I can create a file like this and declare the expected/known Metadata.
What alternatives have you considered?
No response
Additional context
This is what
./ts-defs-src/test-api/test-info.d.ts
should look like.