diff --git a/gulpfile.config.js b/gulpfile.config.js index 2e2b67cd..7487fe80 100644 --- a/gulpfile.config.js +++ b/gulpfile.config.js @@ -58,6 +58,11 @@ module.exports = { 'babybuddy.scss' ] }, + testsConfig: { + isolated: [ + 'babybuddy.tests.tests_formats.FormatsTestCase.test_use_24_hour_time_format_en' + ], + }, watchConfig: { scriptsGlob: [ '*/static_src/js/**/*.js', diff --git a/gulpfile.js b/gulpfile.js index c0677a80..f98e43c1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -2,6 +2,7 @@ var gulp = require('gulp'); var concat = require('gulp-concat'); var del = require('del'); +var es = require('child_process').execSync; var flatten = require('gulp-flatten'); var pump = require('pump'); var sass = require('gulp-sass'); @@ -47,7 +48,16 @@ function coverage(cb) { { stdio: 'inherit' } - ).on('exit', cb); + ).on('exit', function() { + // Add coverage for isolated tests. + config.testsConfig.isolated.forEach(function(test_name) { + es( + 'pipenv run coverage run -a manage.py test ' + test_name, + {stdio: 'inherit'} + ); + }) + cb(); + }); } /** @@ -176,7 +186,16 @@ function test(cb) { 'isolate' ]; command = command.concat(process.argv.splice(3)); - spawn('pipenv', command, { stdio: 'inherit' }).on('exit', cb); + spawn('pipenv', command, { stdio: 'inherit' }).on('exit', function() { + // Run isolated tests. + config.testsConfig.isolated.forEach(function(test_name) { + es( + 'pipenv run python manage.py test ' + test_name, + {stdio: 'inherit'} + ); + }) + cb(); + }); } /**