diff --git a/.travis.yml b/.travis.yml index 0cdfdc0b1c..1122bcca67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,6 +50,7 @@ before_script: - "./bin/developer phraseanet:regenerate-sqlite" - "./bin/developer phraseanet:generate-js-fixtures" script: + - "./node_modules/.bin/gulp test" - | if [ "$TEST_SUITE" = "1" ]; then "./bin/phpunit" "tests/classes/"; diff --git a/circle.yml b/circle.yml index 7e5229e461..b5bed01e3c 100644 --- a/circle.yml +++ b/circle.yml @@ -42,5 +42,6 @@ database: test: override: + - case $CIRCLE_NODE_INDEX in 0) php -d memory_limit=-1 bin/phpunit --exclude-group legacy ;; 1) ./node_modules/.bin/gulp test ;; 2) php -d memory_limit=-1 bin/phpunit --group legacy --exclude-group web ;; 3) php -d memory_limit=-1 bin/phpunit --group web ;; esac: - case $CIRCLE_NODE_INDEX in 0) php -d memory_limit=-1 bin/phpunit --exclude-group legacy ;; 1) php -d memory_limit=-1 bin/phpunit --group legacy --exclude-group web ;; 2) php -d memory_limit=-1 bin/phpunit --group web ;; esac: parallel: true diff --git a/resources/gulp/components/prod.js b/resources/gulp/components/prod.js index de06c1636b..c443c67c1f 100644 --- a/resources/gulp/components/prod.js +++ b/resources/gulp/components/prod.js @@ -1,6 +1,7 @@ var gulp = require('gulp'); var config = require('../config.js'); var utils = require('../utils.js'); +var qunit = require('gulp-qunit'); var debugMode = false; @@ -107,6 +108,12 @@ gulp.task('build-prod-js', function(){ ]; return utils.buildJsGroup(prodGroup, 'prod', 'prod/js', debugMode); }); + +gulp.task('test-prod', function () { + return gulp.src(config.paths.src + 'prod/js/tests/*.html') + .pipe(qunit()); +}); + gulp.task('watch-prod-js', function() { debugMode = true; return gulp.watch(config.paths.src + 'prod/**/*.js', ['build-prod-js']); diff --git a/resources/gulp/test.js b/resources/gulp/test.js index e782d7898d..bac18253ee 100644 --- a/resources/gulp/test.js +++ b/resources/gulp/test.js @@ -4,14 +4,8 @@ var mochaPhantomjs = require('gulp-mocha-phantomjs'); var config = require('./config.js'); -var paths = { - vendors: 'tmp-assets/', - dist: 'www/assets/' -}; - - gulp.task('mocha_phantomjs', function () { - return gulp.src('www/scripts/tests/*.html') + return gulp.src('www/scripts/tests/!*.html') .pipe(mochaPhantomjs({ 'reporter': 'dot', 'setting': [ @@ -20,11 +14,11 @@ gulp.task('mocha_phantomjs', function () { })); }); -gulp.task('qunit', function () { - return gulp.src('www/include/js/tests/*.html') - .pipe(qunit()); +gulp.task('test-components', function () { + return gulp.start('test-prod'); }); - -// js fixtures should be present (./bin/developer phraseanet:generate-js-fixtures) -gulp.task('test', ['qunit','mocha_phantomjs']); \ No newline at end of file +// JS fixtures should be present (./bin/developer phraseanet:generate-js-fixtures) +// Note: fixture are loaded into scripts/tests/fixtures directory using +// bin/developer phraseanet:regenerate-js-fixtures +gulp.task('test', ['test-components']); \ No newline at end of file diff --git a/resources/www/prod/js/tests/jquery.Edit.js.html b/resources/www/prod/js/tests/jquery.Edit.js.html index cf44ea6336..ae93910f6e 100644 --- a/resources/www/prod/js/tests/jquery.Edit.js.html +++ b/resources/www/prod/js/tests/jquery.Edit.js.html @@ -3,10 +3,10 @@ - - + + - + - + + - + - - - - - + + + + + + - - + + + - - + + + - - + + + - - + + +