jest-html-reporter
Version:
Jest test results processor for generating a summary in HTML
277 lines (265 loc) • 5.13 kB
CSS
:root {
--text-primary: #111;
--text-secondary: #4f4f4f;
--success: #006633;
--success-bright: #80ffbf;
--danger: #cc071e;
--danger-bright: #fbdfe0;
--warning: #995c00;
--warning-bright: #ffeea8;
--panel: #eee;
--border: #949494;
--disabled: #6b6b6b;
}
html,
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 16px;
margin: 0;
padding: 0;
color: var(--text-primary);
}
body {
padding: 2rem 1rem;
}
.jesthtml-content {
margin: 0 auto;
max-width: 70rem;
}
header {
display: flex;
align-items: center;
}
#title {
margin: 0;
flex-grow: 1;
}
#logo {
height: 4rem;
}
#timestamp {
color: var(--text-secondary);
margin-top: 0.5rem;
}
#metadata-container {
display: flex;
flex-direction: column;
gap: 2rem;
margin-bottom: 2rem;
}
.additional-information-container {
display: flex;
flex-direction: column;
gap: 0.5rem;
color: var(--text-secondary);
}
/** SUMMARY */
#summary {
color: var(--text-primary);
display: flex;
font-family: monospace;
font-size: 1rem;
}
#summary > div {
margin-right: 0.5rem;
background: var(--panel);
padding: 1rem;
min-width: 15rem;
}
#summary > div:last-child {
margin-right: 0;
}
@media only screen and (max-width: 720px) {
#summary {
flex-direction: column;
}
#summary > div {
margin-right: 0;
margin-top: 1rem;
}
#summary > div:first-child {
margin-top: 0;
}
}
.summary-total {
font-weight: bold;
margin-bottom: 0.5rem;
}
.summary-passed {
color: var(--success);
border-left: 0.4rem solid var(--success);
padding-left: 0.5rem;
margin-bottom: 0.15rem;
}
.summary-failed,
.summary-obsolete-snapshots {
color: var(--danger);
border-left: 0.4rem solid var(--danger);
padding-left: 0.5rem;
margin-bottom: 0.15rem;
}
.summary-pending {
color: var(--warning);
border-left: 0.4rem solid var(--warning);
padding-left: 0.5rem;
margin-bottom: 0.15rem;
}
.summary-empty {
color: var(--disabled);
border-left: 0.4rem solid var(--disabled);
margin-bottom: 0.15rem;
}
.test-result {
padding: 1rem;
margin-bottom: 0.25rem;
}
.test-result:last-child {
border: 0;
}
.test-result.passed {
background-color: var(--success-bright);
color: var(--success);
}
.test-result.failed {
background-color: var(--danger-bright);
color: var(--danger);
}
.test-result.pending {
background-color: var(--warning-bright);
color: var(--warning);
}
.test-info {
display: flex;
justify-content: space-between;
}
.test-suitename {
width: 20%;
text-align: left;
font-weight: bold;
word-break: break-word;
}
.test-title {
width: 40%;
text-align: left;
font-style: italic;
}
.test-status {
width: 20%;
text-align: right;
}
.test-duration {
width: 10%;
text-align: right;
font-size: 0.85rem;
}
.failureMessages {
padding: 0 1rem;
margin-top: 1rem;
border-top: 1px dashed var(--danger);
}
.failureMessages.suiteFailure {
border-top: none;
}
.failureMsg {
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.suite-container {
margin-bottom: 1rem;
}
.suite-info {
padding: 1rem;
background-color: var(--panel);
color: var(--text-secondary);
border: 0.15rem solid;
border-color: var(--panel);
display: flex;
align-items: center;
margin-bottom: 0.25rem;
}
.suite-info:hover {
border-color: var(--border);
cursor: pointer;
}
.suite-info .suite-path {
word-break: break-all;
flex-grow: 1;
font-family: monospace;
font-size: 1rem;
}
.suite-info .suite-time {
margin-left: 1rem;
padding: 0.2rem 0.3rem;
font-size: 0.85rem;
}
.suite-info .suite-time.warn {
background-color: var(--danger);
color: #fff;
}
.suite-info:before {
content: "\2303";
display: inline-block;
margin-right: 1rem;
transform: rotate(180deg) translateY(0.15rem);
}
.suite-container[open] .suite-info:before {
transform: rotate(0deg) translateY(0.15rem);
}
/* CONSOLE LOGS */
.suite-consolelog {
margin-bottom: 0.25rem;
padding: 1rem;
background-color: var(--panel);
}
.suite-consolelog-header {
font-weight: bold;
}
.suite-consolelog-item {
padding: 0.5rem;
}
.suite-consolelog-item pre {
margin: 0.5rem 0;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.suite-consolelog-item-origin {
color: var(--text-secondary);
font-weight: bold;
}
.suite-consolelog-item-message {
color: var(--text-primary);
font-size: 1rem;
padding: 0 0.5rem;
}
/* OBSOLETE SNAPSHOTS */
.suite-obsolete-snapshots {
margin-bottom: 0.25rem;
padding: 1rem;
background-color: var(--danger-bright);
color: var(--danger);
}
.suite-obsolete-snapshots-header {
font-weight: bold;
}
.suite-obsolete-snapshots-item {
padding: 0.5rem;
}
.suite-obsolete-snapshots-item pre {
margin: 0.5rem 0;
white-space: pre-wrap;
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
word-wrap: break-word;
}
.suite-obsolete-snapshots-item-message {
color: var(--text-primary);
font-size: 1rem;
padding: 0 0.5rem;
}