juliemr / minijasminenode

A very bare-bones version of jasmine-node
MIT License
32 stars 21 forks source link

Make jasmine re-initializable by cloning rather than copying into node's global name-space #10

Closed jasonpvp closed 10 years ago

jasonpvp commented 10 years ago

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 jasonpvp@gmail.com

jasonpvp commented 10 years ago

oops - missed something. It doesn't work like I thought it would after installing it from scratch.