Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Commit

Permalink
runat-1128988: Sync helpers.js with Firefox
Browse files Browse the repository at this point in the history
Someone had added an assert.ok, and we protect ourselves against null
DOM nodes in checking test output

Signed-off-by: Joe Walker <[email protected]>
  • Loading branch information
joewalker committed Mar 12, 2015
1 parent d62af41 commit 271e262
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/gcli/test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ helpers._exec = function(options, name, expected) {
}
else {
convertPromise = output.convert('dom', context).then(function(node) {
return node.textContent.trim();
return (node == null) ? '' : node.textContent.trim();
});
}

Expand Down Expand Up @@ -791,6 +791,10 @@ helpers.audit = function(options, audits) {
'due to ' + audit.skipRemainingIf.name :
'';
assert.log('Skipped ' + name + ' ' + skipReason);

// Tests need at least one pass, fail or todo. Create a dummy pass
assert.ok(true, 'Each test requires at least one pass, fail or todo');

return Promise.resolve(undefined);
}
}
Expand Down

1 comment on commit 271e262

@bgrins
Copy link

@bgrins bgrins commented on 271e262 Mar 13, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

Please sign in to comment.