From 5b68d1a06b7be4a7c094952c20361736c33656f9 Mon Sep 17 00:00:00 2001 From: Adam Gruber Date: Wed, 11 Feb 2015 07:50:35 -0500 Subject: [PATCH 1/4] rename index to mochawsome for clarity --- lib/{index.js => mochawesome.js} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/{index.js => mochawesome.js} (100%) diff --git a/lib/index.js b/lib/mochawesome.js similarity index 100% rename from lib/index.js rename to lib/mochawesome.js From 1d57fe7f67de56d56ba005f407f25e9fde267e73 Mon Sep 17 00:00:00 2001 From: Adam Gruber Date: Wed, 11 Feb 2015 07:50:54 -0500 Subject: [PATCH 2/4] update reporter path for local testing --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index 6947444..92d5b3c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -15,7 +15,7 @@ var gulp = require('gulp'), config = require('./lib/config'); var mochaOpts = { - reporter: 'mochawesome', + reporter: path.join(__dirname, 'lib', 'mochawesome'), timeout: 30000, slow: 1, 'no-exit': true From 92990201b953ed5b7e476e8f05ec331d9f599ce5 Mon Sep 17 00:00:00 2001 From: Adam Gruber Date: Wed, 11 Feb 2015 07:51:14 -0500 Subject: [PATCH 3/4] update template build file --- lib/templates.js | 120 +++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/lib/templates.js b/lib/templates.js index 3221a9e..0682dd0 100644 --- a/lib/templates.js +++ b/lib/templates.js @@ -17,66 +17,6 @@ var Handlebars = require("handlebars"); + escapeExpression(((helper = (helper = helpers.pending || (depth0 != null ? depth0.pending : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"pending","hash":{},"data":data}) : helper))) + "\n"; },"useData":true})); -exports["mochawesome"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = this.invokePartial(partials._quickSummary, ' ', '_quickSummary', depth0, undefined, helpers, partials, data); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"3":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = this.invokePartial(partials._summary, ' ', '_summary', depth0, undefined, helpers, partials, data); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"5":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = ""; - stack1 = ((helper = (helper = helpers.hasOther || (depth0 != null ? depth0.hasOther : depth0)) != null ? helper : helperMissing),(options={"name":"hasOther","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.hasOther) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - stack1 = ((helper = (helper = helpers.hasSkipped || (depth0 != null ? depth0.hasSkipped : depth0)) != null ? helper : helperMissing),(options={"name":"hasSkipped","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.hasSkipped) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - return buffer; -},"6":function(depth0,helpers,partials,data) { - return " has-failed-hooks"; - },"8":function(depth0,helpers,partials,data) { - return " has-skipped-tests"; - },"10":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = this.invokePartial(partials._statusbar, ' ', '_statusbar', depth0, undefined, helpers, partials, data); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"12":function(depth0,helpers,partials,data) { - var stack1, buffer = ""; - stack1 = this.invokePartial(partials._suite, ' ', '_suite', depth0, undefined, helpers, partials, data); - if (stack1 != null) { buffer += stack1; } - return buffer; -},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { - var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n\n \n \n \n \n Mochawesome Report Card\n \n \n \n \n
\n
\n
\n

" - + escapeExpression(((helper = (helper = helpers.reportTitle || (depth0 != null ? depth0.reportTitle : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"reportTitle","hash":{},"data":data}) : helper))) - + "

\n

" - + escapeExpression(((helpers.dateFormat || (depth0 && depth0.dateFormat) || helperMissing).call(depth0, ((stack1 = (depth0 != null ? depth0.stats : depth0)) != null ? stack1.end : stack1), "dddd, MMMM D YYYY, hh:mma", {"name":"dateFormat","hash":{},"data":data}))) - + "

\n
\n
\n"; - stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n
\n\n \n
\n
\n"; - stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n
\n
\n"; - stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - buffer += "
\n
\n\n \n
\n"; - stack1 = ((helper = (helper = helpers.suites || (depth0 != null ? depth0.suites : depth0)) != null ? helper : helperMissing),(options={"name":"suites","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); - if (!helpers.suites) { stack1 = blockHelperMissing.call(depth0, stack1, options); } - if (stack1 != null) { buffer += stack1; } - return buffer + "
\n\n \n\n \n \n \n \n\n"; -},"usePartial":true,"useData":true}); /*global Handlebars*/ var moment = require('moment'); @@ -155,6 +95,66 @@ Handlebars.registerHelper('dateFormat', function(context, format) { return moment(context).format(format); } }); +exports["mochawesome"] = Handlebars.template({"1":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = this.invokePartial(partials._quickSummary, ' ', '_quickSummary', depth0, undefined, helpers, partials, data); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"3":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = this.invokePartial(partials._summary, ' ', '_summary', depth0, undefined, helpers, partials, data); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"5":function(depth0,helpers,partials,data) { + var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, blockHelperMissing=helpers.blockHelperMissing, buffer = ""; + stack1 = ((helper = (helper = helpers.hasOther || (depth0 != null ? depth0.hasOther : depth0)) != null ? helper : helperMissing),(options={"name":"hasOther","hash":{},"fn":this.program(6, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.hasOther) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + stack1 = ((helper = (helper = helpers.hasSkipped || (depth0 != null ? depth0.hasSkipped : depth0)) != null ? helper : helperMissing),(options={"name":"hasSkipped","hash":{},"fn":this.program(8, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.hasSkipped) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + return buffer; +},"6":function(depth0,helpers,partials,data) { + return " has-failed-hooks"; + },"8":function(depth0,helpers,partials,data) { + return " has-skipped-tests"; + },"10":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = this.invokePartial(partials._statusbar, ' ', '_statusbar', depth0, undefined, helpers, partials, data); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"12":function(depth0,helpers,partials,data) { + var stack1, buffer = ""; + stack1 = this.invokePartial(partials._suite, ' ', '_suite', depth0, undefined, helpers, partials, data); + if (stack1 != null) { buffer += stack1; } + return buffer; +},"compiler":[6,">= 2.0.0-beta.1"],"main":function(depth0,helpers,partials,data) { + var stack1, helper, options, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression, blockHelperMissing=helpers.blockHelperMissing, buffer = "\n\n \n \n \n \n Mochawesome Report Card\n \n \n \n \n
\n
\n
\n

" + + escapeExpression(((helper = (helper = helpers.reportTitle || (depth0 != null ? depth0.reportTitle : depth0)) != null ? helper : helperMissing),(typeof helper === functionType ? helper.call(depth0, {"name":"reportTitle","hash":{},"data":data}) : helper))) + + "

\n

" + + escapeExpression(((helpers.dateFormat || (depth0 && depth0.dateFormat) || helperMissing).call(depth0, ((stack1 = (depth0 != null ? depth0.stats : depth0)) != null ? stack1.end : stack1), "dddd, MMMM D YYYY, hh:mma", {"name":"dateFormat","hash":{},"data":data}))) + + "

\n
\n
\n"; + stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(1, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + buffer += "
\n
\n
\n\n \n
\n
\n"; + stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(3, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + buffer += "
\n
\n
\n
\n"; + stack1 = ((helper = (helper = helpers.stats || (depth0 != null ? depth0.stats : depth0)) != null ? helper : helperMissing),(options={"name":"stats","hash":{},"fn":this.program(10, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.stats) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + buffer += "
\n
\n\n \n
\n"; + stack1 = ((helper = (helper = helpers.suites || (depth0 != null ? depth0.suites : depth0)) != null ? helper : helperMissing),(options={"name":"suites","hash":{},"fn":this.program(12, data),"inverse":this.noop,"data":data}),(typeof helper === functionType ? helper.call(depth0, options) : helper)); + if (!helpers.suites) { stack1 = blockHelperMissing.call(depth0, stack1, options); } + if (stack1 != null) { buffer += stack1; } + return buffer + "
\n\n \n\n \n \n \n \n\n"; +},"usePartial":true,"useData":true}); Handlebars.registerPartial("_statusbar", Handlebars.template({"1":function(depth0,helpers,partials,data) { var helper, functionType="function", helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression; return "
" From e3796032cf89ce81a9c1455a4835df8c813ed3ab Mon Sep 17 00:00:00 2001 From: Adam Gruber Date: Wed, 11 Feb 2015 10:04:15 -0500 Subject: [PATCH 4/4] version bump --- README.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 11e75d7..482835e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ mochawesome =========== -[![npm](http://img.shields.io/badge/npm-1.0.1-green.svg?style=flat-square)](http://registry.npm.wsjfdev.dowjones.net/mochawesome) [![Build Status](https://travis-ci.org/adamgruber/mochawesome.svg?branch=master)](https://travis-ci.org/adamgruber/mochawesome) [![Code Climate](https://codeclimate.com/github/adamgruber/mochawesome/badges/gpa.svg)](https://codeclimate.com/github/adamgruber/mochawesome) +[![npm](http://img.shields.io/badge/npm-1.0.2-green.svg?style=flat-square)](http://registry.npm.wsjfdev.dowjones.net/mochawesome) [![Build Status](https://travis-ci.org/adamgruber/mochawesome.svg?branch=master)](https://travis-ci.org/adamgruber/mochawesome) [![Code Climate](https://codeclimate.com/github/adamgruber/mochawesome/badges/gpa.svg)](https://codeclimate.com/github/adamgruber/mochawesome) Mochawesome is a custom reporter for use with the Javascript testing framework, [mocha](http://visionmedia.github.io/mocha/). It generates a full fledged HTML/CSS report that helps visualize your test suites. diff --git a/package.json b/package.json index 3859e7a..bb94b03 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mochawesome", - "version": "1.0.1", + "version": "1.0.2", "description": "A Gorgeous HTML/CSS Reporter for Mocha.js", "scripts": { "test": "gulp build"