Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Uncache module Build Status

Helper for uncaching node modules to allow run tests within the same process as gulp tasks

Installation

npm install uncache-modules

Usage

var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var uncacheModules = require('uncache-modules');

var testServer;
gulp.task('run-test-server', function(cb) {
    if (testServer) {
        testServer.close();
        uncacheModules('./src');
    }
    testServer = require('./src/app');
    testServer.on('listening', cb);
});

gulp.task('run-tests', ['run-test-server'], function(cb) {
    return gulp.src('test.js')
        .pipe(jasmine({ verbose: false }));
});

gulp.task('watch', function() {
    gulp.start('run-tests');
    gulp.watch(['test.js','src/**/*.js'], ['run-tests']);
})

Development

npm install -g gulp
gulp test

About

Remove nodejs modules from module cache

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages