mutualize casperjsOptions in gruntfile

This commit is contained in:
Julian Descottes 2017-01-08 16:39:55 +01:00
parent d30f6a05d1
commit 569b508fd5

View File

@ -32,6 +32,16 @@ module.exports = function(grunt) {
var stylePaths = require('./src/piskel-style-list.js').styles; var stylePaths = require('./src/piskel-style-list.js').styles;
var piskelStyles = prefixPaths(stylePaths, "src/"); var piskelStyles = prefixPaths(stylePaths, "src/");
// Casper JS tests
var casperjsOptions = [
'--baseUrl=http://' + hostname + ':' + PORT.TEST,
'--mode=?debug',
'--verbose=false',
'--log-level=info',
'--print-command=false',
'--print-file-paths=true',
];
var drawingTestPaths = require('./test/casperjs/TestSuite.js').tests; var drawingTestPaths = require('./test/casperjs/TestSuite.js').tests;
var drawingTests = prefixPaths(drawingTestPaths, "test/casperjs/"); var drawingTests = prefixPaths(drawingTestPaths, "test/casperjs/");
@ -273,14 +283,7 @@ module.exports = function(grunt) {
src: drawingTests src: drawingTests
}, },
options : { options : {
casperjsOptions: [ casperjsOptions: casperjsOptions
'--baseUrl=http://' + hostname + ':' + PORT.TEST,
'--mode=?debug',
'--verbose=false',
'--log-level=info',
'--print-command=false',
'--print-file-paths=true',
]
} }
}, },
integration : { integration : {
@ -288,14 +291,7 @@ module.exports = function(grunt) {
src: integrationTests src: integrationTests
}, },
options : { options : {
casperjsOptions: [ casperjsOptions: casperjsOptions
'--baseUrl=http://' + hostname + ':' + PORT.TEST,
'--mode=?debug',
'--verbose=false',
'--log-level=info',
'--print-command=false',
'--print-file-paths=true',
]
} }
} }
}, },