Skip to content

Commit

Permalink
Merge pull request #43 from adamgruber/develop
Browse files Browse the repository at this point in the history
1.3.3
  • Loading branch information
adamgruber committed Apr 10, 2016
2 parents ebc0564 + aaeb0ec commit 2da7f7a
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 11 deletions.
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
language: node_js
node_js:
- "0.10"
- "0.10"
- "0.12"
- "4"
- "5"
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#Changelog

###1.3.3
- Added support for creating custom dir where the parent dir(s) may not exist yet. See [#40](https://github.com/adamgruber/mochawesome/issues/40)

###1.3.2
- Removed `allHooks` array since it was not being used and could lead to an issue where node runs out of memory while rendering the template. See [#33](https://github.com/adamgruber/mochawesome/issues/33)

Expand Down
24 changes: 19 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ var gulp = require('gulp'),
wrap = require('gulp-wrap'),
declare = require('gulp-declare'),
watch = require('gulp-watch'),
mocha = require('gulp-spawn-mocha'),
mocha = require('gulp-mocha'),
spawnmocha = require('gulp-spawn-mocha'),
config = require('./lib/config')();

var mochaOpts = {
Expand All @@ -29,8 +30,9 @@ var watchFiles = [
];

var testPaths = {
basic: ['./test/test.js'],
mem: ['./test/mem-test.js'],
basic: ['./test/basic/test.js'],
mem: ['./test/basic/mem-test.js'],
recursive: ['./test/basic'],
fiveby: [
'./test/fiveby/*.js',
'./test/fiveby/**/*.js'
Expand Down Expand Up @@ -156,7 +158,7 @@ gulp.task('watch', function () {
// Test Tasks
gulp.task('fiveby', function () {
return gulp.src(testPaths.fiveby)
.pipe(mocha(mochaOpts))
.pipe(spawnmocha(mochaOpts))
.on('error', console.warn.bind(console));
});

Expand All @@ -172,8 +174,20 @@ gulp.task('mem-test', function () {
.on('error', console.warn.bind(console));
});

gulp.task('test-recursive', function () {
mochaOpts.recursive = true;
return gulp.src(testPaths.recursive)
.pipe(mocha(mochaOpts))
.on('error', console.warn.bind(console));
});

gulp.task('testOpts', function () {
mochaOpts.reporterOptions = 'reportDir=customDir,reportName=customName,reportTitle=customTitle,inlineAssets=true';
mochaOpts.reporterOptions = {
reportDir: 'customDir',
reportName: 'customName',
reportTitle: 'customTitle',
inlineAssets: true
};
return gulp.src(testPaths.basic)
.pipe(mocha(mochaOpts))
.on('error', console.warn.bind(console));
Expand Down
7 changes: 3 additions & 4 deletions lib/reportGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ var async = require('async'),
fs = require('fs'),
ncp = require('ncp'),
_ = require('lodash'),
chalk = require('chalk');
chalk = require('chalk'),
mkdirp = require('mkdirp');

exports.generateReport = generateReport;
exports.saveToFile = saveToFile;
Expand Down Expand Up @@ -47,9 +48,7 @@ function createDirs (config, inline, callback) {
dirs = dirs.concat([config.reportJsDir, config.reportFontsDir, config.reportCssDir]);
}
dirs.forEach(function(dir) {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir);
}
mkdirp.sync(dir);
});
callback(null, 'done');
}
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mochawesome",
"version": "1.3.2",
"version": "1.3.3",
"description": "A Gorgeous HTML/CSS Reporter for Mocha.js",
"scripts": {
"test": "gulp build"
Expand All @@ -26,6 +26,7 @@
"highlight.js": "^8.5.0",
"json-stringify-safe": "^5.0.0",
"lodash": "^3.1.0",
"mkdirp": "^0.5.1",
"mocha": "*",
"moment": "^2.9.0",
"ncp": "^1.0.1",
Expand All @@ -41,6 +42,7 @@
"gulp-handlebars": "^4.0.0",
"gulp-jshint": "^1.9.0",
"gulp-less": "^3.0.3",
"gulp-mocha": "^2.2.0",
"gulp-plumber": "^0.6.6",
"gulp-spawn-mocha": "^0.5.2",
"gulp-uglify": "^1.1.0",
Expand Down
File renamed without changes.
14 changes: 14 additions & 0 deletions test/basic/subfolder/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var should = require('should');

describe('Subfolder Test Suite', function () {
describe('Test Suite - Basic', function () {
it('passing test', function (done) {
true.should.be.ok;
done();
});
it('failing test', function (done) {
false.should.be.ok;
done();
});
});
});
File renamed without changes.

0 comments on commit 2da7f7a

Please sign in to comment.