test('formats a well-formed violation', function(assert) { let violation = { name: 'test', impact: 'critical', help: 'it should be better', helpUrl: 'http://example.com' }; let message = formatViolation(violation); let expected = `[critical]: it should be better \nViolated 1 time.\nhttp://example.com`; assert.equal(message, expected); });
test('formats a well-formed violation and relevant html', function(assert) { let violation = { name: 'test', impact: 'critical', help: 'it should be better', helpUrl: 'http://example.com', nodes: [ { target: ['.some-class'], html: '<input type="text">' } ] }; let message = formatViolation(violation, violation.nodes[0].html); let expected = `[critical]: it should be better \nViolated 1 time. Offending nodes are: \n<input type="text">\nhttp://example.com`; assert.equal(message, expected); });
function() { formatViolation(); },
function() { formatViolation(violation, violation.nodes[0].html); },