Skip to content

Commit

Permalink
fix(report): include earl:result for documents that have no assertions
Browse files Browse the repository at this point in the history
documents that pass automatic checks will have no assertions, but the earl:result object must be created for them anyway

fixes #120
  • Loading branch information
marisademeglio committed Dec 11, 2017
1 parent 4ecff5a commit d131450
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/report/axe2ace.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const kbMap = {
function axe2ace(spineItem, axeResults) {
winston.verbose(`Converting aXe results to ace for ${spineItem.relpath}`);

// the top-level assertion
// the content doc-level assertion
const assertion = new builders.AssertionBuilder()
.withSubAssertions()
.withTestSubject(spineItem.relpath, spineItem.title);
Expand Down
2 changes: 2 additions & 0 deletions src/report/report-builders.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function withTestSubject(obj, url, title = '', identifier = '', metadata = null)
class AssertionBuilder {
constructor() {
this._json = { '@type': 'earl:assertion' };
var result = new ResultBuilder('pass').build();
this.withResult(result); // default result until we know more
}
build() {
return this._json;
Expand Down

0 comments on commit d131450

Please sign in to comment.