@as-pect/json-reporter
v9.0.0
Published
Json reporter for as-pect
Readme
jtenner/as-pect - @as-pect/json-reporter
Write your module in AssemblyScript and get blazing fast bootstrapped tests with WebAssembly speeds!
Documentation
To view the documentation, it's located here on the gitbook. If there are any issues with the docs, please feel free to file an issue!
Reporter API
This package writes JSON from the Suite report facts delivered to onReportFinish({ report }). Custom file reporters should prefer the report event callbacks from @as-pect/core and treat onFinish(ctx) as a legacy compatibility callback.
as-pect legacy JSON v1 contract
@as-pect/json-reporter is the as-pect legacy JSON reporter. It is selected by asp --json and intentionally remains separate from the standardized CTRF reporter in @as-pect/ctrf-reporter.
The reporter writes one sibling .json file per test entry. The file root is an array of result objects in execution order.
Passing and failing tests use this field shape:
{
"group": "math",
"name": "adds values",
"ran": true,
"pass": true,
"negated": false,
"runtime": 3,
"message": null,
"actual": "3",
"expected": "3"
}Failed tests keep the same fields with pass: false, assertion text in message, and reflected assertion strings in actual and expected when present.
Todo results use the same object shape for compatibility:
{
"group": "math",
"name": "TODO: handles division",
"ran": false,
"pass": null,
"negated": false,
"runtime": 0,
"message": "",
"actual": null,
"expected": null
}Use asp --ctrf or asp --reporter @as-pect/ctrf-reporter when a consumer expects CTRF root fields such as reportFormat, specVersion, and results.
Contributors
To contribute please see CONTRIBUTING.md.
Thanks to @willemneal and
@MaxGraey for all their support in making as-pect the
best software it can be.
Other Contributors:
- @trusktr - Documentation Changes
- @MaxGraey - Performance API suggestions
- @torch2424 - Documentation Changes
- @dcodeio - Made AssemblyScript itself!
- @9oelM - Misc functionalities
Special Thanks
Special thanks to the AssemblyScript team for creating AssemblyScript itself.
