mirror of https://github.com/snachodog/mybuddy.git
Add support for "isolated" tests (#148)
This commit is contained in:
parent
7abe7b2a5f
commit
3005fe3976
|
@ -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',
|
||||
|
|
23
gulpfile.js
23
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();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue