From 4ff6765996ecba817e2a5dcaa549da21a1684d24 Mon Sep 17 00:00:00 2001 From: Leonardo Balter Date: Thu, 4 Sep 2014 17:04:29 -0300 Subject: [PATCH] Reporter: Logs skipped tests --- reporter/html.js | 3 +++ src/qunit.css | 5 +++++ src/test.js | 1 + test/logs.js | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/reporter/html.js b/reporter/html.js index 1a727334b..1e678afda 100644 --- a/reporter/html.js +++ b/reporter/html.js @@ -668,6 +668,9 @@ QUnit.testDone(function( details ) { time.innerHTML = details.runtime + " ms"; testItem.className = bad ? "fail" : "pass"; + if ( details.skipped ) { + addClass( testItem, "skipped" ); + } testItem.insertBefore( time, assertList ); }); diff --git a/src/qunit.css b/src/qunit.css index ca8fe3893..ed53ef64c 100644 --- a/src/qunit.css +++ b/src/qunit.css @@ -211,6 +211,11 @@ #qunit-banner.qunit-fail { background-color: #EE5757; } +/*** Skipped tests */ + +#qunit-tests .skipped { + background-color: #EBECE9; +} /** Result */ diff --git a/src/test.js b/src/test.js index a0946b108..0f03f059d 100644 --- a/src/test.js +++ b/src/test.js @@ -152,6 +152,7 @@ Test.prototype = { runLoggingCallbacks( "testDone", { name: this.testName, module: this.module, + skipped: !!this.skip, failed: bad, passed: this.assertions.length - bad, total: this.assertions.length, diff --git a/test/logs.js b/test/logs.js index 0739cc937..92b4e7e5b 100644 --- a/test/logs.js +++ b/test/logs.js @@ -150,7 +150,8 @@ QUnit.test( "test2", function( assert ) { failed: 0, passed: 17, total: 17, - testNumber: 1 + testNumber: 1, + skipped: false }, "testDone context" ); assert.deepEqual( testContext, { module: "logs1",