There are many potential DSLs for defining our tests, however, they will all resolve into a single format that can be understood by the runtime: one that contains a strict tree of actions and assertions.
This is a first stab at that format. It contains a recursive Test structure that is defined with both with TypeScript interfaces, but also with GraphQL IDL. Note that the GraphQL schema does not contain any non-serialiazable objects, specifically the lambdas of the actions and checks which cannot be sent across the wire.
Follow on work from this:
[ ] validating test objects that are imported from the manifest
make sure there is a default export (or maybe a robust algorithm for finding the test export)
validating the format to make sure that there are no tests with the same id ().
[ ] define a DSL function to emit this format.
[ ] create a manifest parser that constructs the test state from JSON
There are many potential DSLs for defining our tests, however, they will all resolve into a single format that can be understood by the runtime: one that contains a strict tree of actions and assertions.
This is a first stab at that format. It contains a recursive Test structure that is defined with both with TypeScript interfaces, but also with GraphQL IDL. Note that the GraphQL schema does not contain any non-serialiazable objects, specifically the lambdas of the actions and checks which cannot be sent across the wire.
Follow on work from this: