digitalbazaar / mocha-w3c-interop-reporter

Mocha W3C Interoperability Test Suite reporter
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Export templateData if a reporter option templateData with a path is specified. #32

Closed aljones15 closed 9 months ago

aljones15 commented 10 months ago

This is a draft PR with a new feature that exports the JSON used to create the HTML report. The json is called the report context as handlebars takes in a context used to format the HTML. This PR might be updated as we figure out ways of producing the collated can I use it page.

BigBlueHat commented 10 months ago

@aljones15 does it have to be called "context" for Handlebars? That's a pretty loaded word around here... Could we not just call it "reportData" or some such?

aljones15 commented 10 months ago

@aljones15 does it have to be called "context" for Handlebars? That's a pretty loaded word around here... Could we not just call it "reportData" or some such?

ok so for handlerbars yes we need a context, but we could pass reportData as the context to handleBars and fix that. One further naming issue: you can add report data to a suite that will show up in the report so reportData might not be the best name maybe formattedReport would be better as that seems more specific to the use of the data structure while also avoiding over used concepts like data and contexts?

https://github.com/digitalbazaar/mocha-w3c-interop-reporter/blob/24a97914805d16d50587791b6c296a8f72952888/README.md?plain=1#L34-L36

This probably should be reportMetaData

some other options: templateData or viewData