Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding test run data to html report #176

Merged
merged 3 commits into from Aug 26, 2014

Conversation

@geek
Copy link
Member

geek commented Aug 26, 2014

Closes #118

Also supports running the html report without coverage data.

@geek geek added the enhancement label Aug 26, 2014
@geek geek added this to the 4.2.0 milestone Aug 26, 2014
@@ -1,15 +1,16 @@
<!doctype html>
<html>
<head>
<title>Coverage</title>
<title>Tests & Coverage</title>

This comment has been minimized.

Copy link
@chrisdickinson
var element = elements[i];
element.className = element.className.replace('hide', '', 'gi');
element.className = element.className.replace('show', '', 'gi');
element.className += ' show';

This comment has been minimized.

Copy link
@chrisdickinson

chrisdickinson Aug 26, 2014

Element.classList is pretty nice: element.classList.remove('hide'); element.classList.add('show');.

document.querySelectorAll is similarly rad, allowing jquery-esque selectors -- not strictly necessary here, though!

if (filterElement.type === 'checkbox') {
filterElement.checked = false;
}
}

This comment has been minimized.

Copy link
@chrisdickinson

chrisdickinson Aug 26, 2014

nit: document.querySelectorAll('input[type=checkbox]') could pre-filter for you here.

@geek geek assigned arb Aug 26, 2014
@@ -32,6 +33,56 @@
}
}
}
function show (className) {

This comment has been minimized.

Copy link
@arb

arb Aug 26, 2014

Contributor

Could you combine show and hide into a single function and call it toggle or something? They look all but identical.

@@ -179,6 +230,31 @@
color: #b6b6b6;
}
.stats .failures::after {
content: ' Failures';
color: #b6b6b6;

This comment has been minimized.

Copy link
@arb

arb Aug 26, 2014

Contributor

You could apply this color to the parent element so it wouldn't need to be repeated on each of these classes.

This comment has been minimized.

Copy link
@geek

geek Aug 26, 2014

Author Member

I only want the text for Failures to be this color, not the number

<div class="duration">{{duration}}</div>
</div>
<div id="filters">
<input type="checkbox" checked="" onchange="filter(this)" value="success" id="show-success"><label for="show-success">Show Success</label></input>

This comment has been minimized.

Copy link
@arb

arb Aug 26, 2014

Contributor

I didn't think you were supposed to set attributes equal to empty strings. Maybe I'm wrong though.

This comment has been minimized.

Copy link
@geek

geek Aug 26, 2014

Author Member

Only way to get checked to be settable

arb added a commit that referenced this pull request Aug 26, 2014
Adding test run data to html report
@arb arb merged commit d581964 into hapijs:master Aug 26, 2014
1 check passed
1 check passed
continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.