juliemr/minijasminenode — pull request #10 by jasonpvp (2014-02-02 05:51:59+00:00)
Title: Make jasmine re-initializable by cloning rather than copying into node's global name-space

This is useful in continuous testing environments, such as under gulp-jasmine

Currently, running gulp-node, which depends upon minijasminenode, with the following config results in subsequent spec executions appending results to the previous output, so a single test will result in an exponential increase in results and counts. This also suggests leaky tests could leave artifacts around to affect subsequent executions. This change allows one to reset jasmine to its initial state before execution of specs. (Sorry about the odd meta-test - couldn't come up with a simple, more elegant way without significantly changing or duplicating cli.js)

sample gulp config:

var gulp = require('gulp'),
jasmine = require('gulp-jasmine')
gulp.task('jasmine', function () {
gulp.src(testFiles)
.pipe(jasmine());
});
gulp.task('default', function() {
gulp.watch(testFiles, ['jasmine'])
});

Signed-off-by: Jason Van Pelt